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 55use CodeOfDigital \CacheRepository \Contracts \CriteriaInterface ;
66use CodeOfDigital \CacheRepository \Contracts \RepositoryInterface ;
77use CodeOfDigital \CacheRepository \Exceptions \RepositoryException ;
8+ use Illuminate \Database \Eloquent \Builder ;
89use Illuminate \Database \Eloquent \Model ;
910use Illuminate \Database \Eloquent \SoftDeletes ;
1011
@@ -13,12 +14,12 @@ class OnlyTrashedCriteria implements CriteriaInterface
1314 /**
1415 * Apply conditions into current query building
1516 *
16- * @param Model $model
17+ * @param Model|Builder $model
1718 * @param RepositoryInterface $repository
1819 * @return mixed
1920 * @throws RepositoryException
2021 */
21- public function apply (Model $ model , RepositoryInterface $ repository ): mixed
22+ public function apply (Model | Builder $ model , RepositoryInterface $ repository ): mixed
2223 {
2324 if (!in_array (SoftDeletes::class, class_uses ($ model )))
2425 throw new RepositoryException ('Model must implement SoftDeletes Trait to use this criteria. ' );
Original file line number Diff line number Diff line change 55use CodeOfDigital \CacheRepository \Contracts \CriteriaInterface ;
66use CodeOfDigital \CacheRepository \Contracts \RepositoryInterface ;
77use CodeOfDigital \CacheRepository \Exceptions \RepositoryException ;
8+ use Illuminate \Database \Eloquent \Builder ;
89use Illuminate \Database \Eloquent \Model ;
910use Illuminate \Database \Eloquent \SoftDeletes ;
1011
@@ -13,12 +14,12 @@ class WithTrashedCriteria implements CriteriaInterface
1314 /**
1415 * Apply conditions into current query building
1516 *
16- * @param Model $model
17+ * @param Model|Builder $model
1718 * @param RepositoryInterface $repository
1819 * @return mixed
1920 * @throws RepositoryException
2021 */
21- public function apply (Model $ model , RepositoryInterface $ repository ): mixed
22+ public function apply (Model | Builder $ model , RepositoryInterface $ repository ): mixed
2223 {
2324 if (!in_array (SoftDeletes::class, class_uses ($ model )))
2425 throw new RepositoryException ('Model must implement SoftDeletes Trait to use this criteria. ' );
You can’t perform that action at this time.
0 commit comments