Skip to content

Commit

Permalink
Merge pull request dev-partners#19 from NickBelhomme/master
Browse files Browse the repository at this point in the history
bugfix - fix softdelete detection
  • Loading branch information
recycledbeans authored Apr 12, 2021
2 parents ef28195 + c5e6740 commit 97f83a7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Http/Controllers/AuditController.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ public function restore(Request $request, $resourceName, $resourceId, $auditId)
protected function loadRecord($resourceName, $resourceId)
{
$model = Nova::modelInstanceForKey($resourceName);

return in_array('Illuminate\Database\Eloquent\SoftDeletes', class_uses($model))
return method_exists($model, "trashed")
? $model::withTrashed()->find($resourceId)
: $model->find($resourceId);
}
Expand Down

0 comments on commit 97f83a7

Please sign in to comment.