Closed jonagoldman closed 3 years ago
In my app models, I override the trashed() method from the SoftDeletes trait to add some custom logic.
trashed()
SoftDeletes
But in Laravel\Nova\Resource, this method is not used:
Laravel\Nova\Resource
public function isSoftDeleted() { return static::softDeletes() && ! is_null($this->resource->{$this->resource->getDeletedAtColumn()}); }
This could be simplified to:
public function isSoftDeleted() { return static::softDeletes() && $this->resource->trashed(); }
This will respect overrides and reduce code duplication.
This has been fixed in v3.27.0: https://nova.laravel.com/releases/3.27.0
Description:
In my app models, I override the
trashed()
method from theSoftDeletes
trait to add some custom logic.But in
Laravel\Nova\Resource
, this method is not used:This could be simplified to:
This will respect overrides and reduce code duplication.