mehdi-fathi / eloquent-filter

Eloquent Filter is a package for filter data of models by the query strings. Easy to use and fully dynamic.
https://mehdi-fathi.github.io/eloquent-filter/
MIT License
430 stars 43 forks source link

How to use directly my custom filter? #209

Closed anonymuos1 closed 2 months ago

anonymuos1 commented 4 months ago

Hi!

How can I use my custom filter in filter() method?

trait ModelFilter
{
    public function filterCustomOwn(Builder $builder, $value) {
    .....
    return $builder;
    }
}

This not work: Model::filter(["own" => 1])->paginate();

But works from url, if I not pass data to filter() method.

Thank you!

mehdi-fathi commented 3 months ago

@anonymuos1

I checked and seems there isn't any problem with it. I guess you made a mistake in another place unless you are sure, provide more information about the problem.