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