EloquentFilter icon indicating copy to clipboard operation
EloquentFilter copied to clipboard

Pagination Seems Broken

Open aalicki opened this issue 9 months ago • 1 comments

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.

aalicki avatar May 02 '24 15:05 aalicki

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?

Tucker-Eric avatar May 03 '24 04:05 Tucker-Eric