File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ class OnlyTrashedCriteria implements CriteriaInterface
2121 */
2222 public function apply (Model |Builder $ model , RepositoryInterface $ repository ): mixed
2323 {
24- if (!in_array (SoftDeletes::class, class_uses ( $ model) ))
24+ if (!method_exists ( $ model, ' onlyTrashed ' ))
2525 throw new RepositoryException ('Model must implement SoftDeletes Trait to use this criteria. ' );
2626
2727 return $ model ->onlyTrashed ();
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ class WithTrashedCriteria implements CriteriaInterface
2121 */
2222 public function apply (Model |Builder $ model , RepositoryInterface $ repository ): mixed
2323 {
24- if (!in_array (SoftDeletes::class, class_uses ( $ model) ))
24+ if (!method_exists ( $ model, ' withTrashed ' ))
2525 throw new RepositoryException ('Model must implement SoftDeletes Trait to use this criteria. ' );
2626
2727 return $ model ->withTrashed ();
You can’t perform that action at this time.
0 commit comments