pingcrm/app/Model.php

21 lines
489 B
PHP

<?php
namespace App;
use Illuminate\Database\Eloquent\Model as BaseModel;
use Illuminate\Database\Eloquent\SoftDeletes;
abstract class Model extends BaseModel
{
protected $guarded = [];
protected $perPage = 10;
public function resolveRouteBinding($value)
{
return in_array(SoftDeletes::class, class_uses($this))
? $this->where($this->getRouteKeyName(), $value)->withTrashed()->first()
: parent::resolveRouteBinding($value);
}
}