How to implements this when models are in the models directory?
omarherri opened this issue · 2 comments
My models are in App\models directory.
So my question is shoud i use that namespace App\EloquentFilters\User?
Another question for exemple i have a fliter named AgeMoreThan, so i should create an AgeMoreThanFilter.php file in EloquentFilters and apply my filter ?
I'm asking this because it throws Not found the filter.
The default namespace is App\EloquentFilters
for all models.
If you want to make the filters on User
model, you should create a new directory in app
named EloquentFilters
and create new directory named User
inside EloquentFilters
.
The result should like this:
app/
├── Console
│ └── Kernel.php
├── EloquentFilters
│ └── User
│ ├── AgeMoreThanFilter.php
│ └── GenderFilter.php // another filter
├── Exceptions
│ └── Handler.php
│...
I suggest read this article .
Feel free for any question.
@mohammad-fouladgar ohh i get it now, thank you a lot for your help it's awesome.