Skip to content

Commit a8fc71c

Browse files
committed
Minor fix
1 parent b000abd commit a8fc71c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Criteria/OnlyTrashedCriteria.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ class OnlyTrashedCriteria implements CriteriaInterface
2121
*/
2222
public function apply(Model|Builder $model, RepositoryInterface $repository): mixed
2323
{
24-
$model = $model instanceof Builder ? $model->getModel() : $model;
24+
$checkModel = $model instanceof Builder ? $model->getModel() : $model;
2525

26-
if (!in_array(SoftDeletes::class, class_uses($model)))
26+
if (!in_array(SoftDeletes::class, class_uses($checkModel)))
2727
throw new RepositoryException('Model must implement SoftDeletes Trait to use this criteria.');
2828

2929
return $model->onlyTrashed();

src/Criteria/WithTrashedCriteria.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ class WithTrashedCriteria implements CriteriaInterface
2121
*/
2222
public function apply(Model|Builder $model, RepositoryInterface $repository): mixed
2323
{
24-
$model = $model instanceof Builder ? $model->getModel() : $model;
24+
$checkModel = $model instanceof Builder ? $model->getModel() : $model;
2525

26-
if (!in_array(SoftDeletes::class, class_uses($model)))
26+
if (!in_array(SoftDeletes::class, class_uses($checkModel)))
2727
throw new RepositoryException('Model must implement SoftDeletes Trait to use this criteria.');
2828

2929
return $model->withTrashed();

0 commit comments

Comments
 (0)