Tucker-Eric / EloquentFilter

An Eloquent Way To Filter Laravel Models And Their Relationships
http://tucker-eric.github.io/EloquentFilter
MIT License
1.72k stars 120 forks source link

Pagination Seems Broken #201

Open aalicki opened 5 months ago

aalicki commented 5 months ago

Laravel: 10.0 PHP Ver: 8.2 EloquentFilter Ver: Latest (3.3)

Problem:

I am attempting a basic filtering on a model, in doing so I'm applying ->simplePaginateFilter() or ->paginateFilter() and neither seem to work. I get an error Call to undefined method Illuminate\Database\Eloquent\Builder::simplePaginateFilter()

Code Examples:

$data = Item::filter($request->all())->simplePaginateFilter();

$data = Item::filter($request->all())->paginateFilter();

Error Returned: Call to undefined method Illuminate\Database\Eloquent\Builder::simplePaginateFilter()


Potential Documentation Bug?

When I chain ->paginateSimple() to the query, it works without issue.

Tucker-Eric commented 5 months ago

Hmm, those methods are actually local scopes on the model. Have you done anything that would cause the scopes to not be caught by Eloquent?