You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-26Lines changed: 1 addition & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,32 +90,6 @@ use Illuminate\Database\Eloquent\Builder;
90
90
use Freevital\Repository\Contracts\CriteriaContract;
91
91
use Freevital\Repository\Contracts\RepositoryContract;
92
92
93
-
class BySlugCriteria implements CriteriaContract
94
-
{
95
-
/**
96
-
* Apply criteria in query repository.
97
-
*
98
-
* @param Builder $query
99
-
* @param RepositoryContract $repository
100
-
*
101
-
* @return \Illuminate\Database\Eloquent\Builder
102
-
*/
103
-
public function apply(Builder $query, RepositoryContract $repository)
104
-
{
105
-
return $query->with('comments.users');
106
-
}
107
-
}
108
-
```
109
-
110
-
You may TODO
111
-
112
-
```php
113
-
namespace App\Repositories\Criteria;
114
-
115
-
use Illuminate\Database\Eloquent\Builder;
116
-
use Freevital\Repository\Contracts\CriteriaContract;
117
-
use Freevital\Repository\Contracts\RepositoryContract;
118
-
119
93
class BySlugCriteria implements CriteriaContract
120
94
{
121
95
/**
@@ -181,6 +155,7 @@ class PostController extends Controller
181
155
182
156
## Criteria Macros
183
157
158
+
184
159
If you would like to extend the repository functionality with custom common scope (ex. ActiveCriteria), you may use BaseRepository's macro method. For example, from a service provider's boot method:
0 commit comments