File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 5
5
use CodeOfDigital \CacheRepository \Contracts \CriteriaInterface ;
6
6
use CodeOfDigital \CacheRepository \Contracts \RepositoryInterface ;
7
7
use CodeOfDigital \CacheRepository \Exceptions \RepositoryException ;
8
+ use Illuminate \Database \Eloquent \Builder ;
8
9
use Illuminate \Database \Eloquent \Model ;
9
10
use Illuminate \Database \Eloquent \SoftDeletes ;
10
11
@@ -13,12 +14,12 @@ class OnlyTrashedCriteria implements CriteriaInterface
13
14
/**
14
15
* Apply conditions into current query building
15
16
*
16
- * @param Model $model
17
+ * @param Model|Builder $model
17
18
* @param RepositoryInterface $repository
18
19
* @return mixed
19
20
* @throws RepositoryException
20
21
*/
21
- public function apply (Model $ model , RepositoryInterface $ repository ): mixed
22
+ public function apply (Model | Builder $ model , RepositoryInterface $ repository ): mixed
22
23
{
23
24
if (!in_array (SoftDeletes::class, class_uses ($ model )))
24
25
throw new RepositoryException ('Model must implement SoftDeletes Trait to use this criteria. ' );
Original file line number Diff line number Diff line change 5
5
use CodeOfDigital \CacheRepository \Contracts \CriteriaInterface ;
6
6
use CodeOfDigital \CacheRepository \Contracts \RepositoryInterface ;
7
7
use CodeOfDigital \CacheRepository \Exceptions \RepositoryException ;
8
+ use Illuminate \Database \Eloquent \Builder ;
8
9
use Illuminate \Database \Eloquent \Model ;
9
10
use Illuminate \Database \Eloquent \SoftDeletes ;
10
11
@@ -13,12 +14,12 @@ class WithTrashedCriteria implements CriteriaInterface
13
14
/**
14
15
* Apply conditions into current query building
15
16
*
16
- * @param Model $model
17
+ * @param Model|Builder $model
17
18
* @param RepositoryInterface $repository
18
19
* @return mixed
19
20
* @throws RepositoryException
20
21
*/
21
- public function apply (Model $ model , RepositoryInterface $ repository ): mixed
22
+ public function apply (Model | Builder $ model , RepositoryInterface $ repository ): mixed
22
23
{
23
24
if (!in_array (SoftDeletes::class, class_uses ($ model )))
24
25
throw new RepositoryException ('Model must implement SoftDeletes Trait to use this criteria. ' );
You can’t perform that action at this time.
0 commit comments