tracker icon indicating copy to clipboard operation
tracker copied to clipboard

Error when using paginate() on Tracker methods

Open charlie-glitch opened this issue 4 years ago • 1 comments

Hi,

I'm trying to use the paginate method on Tracker::methods. Example : Tracker::sessions(60 * 24)->paginate(20);

When using paginate() I got the following error :

Method Illuminate\Database\Eloquent\Collection::paginate does not exist.

The documentation says : Most of those methods return an Eloquent model... So I think it is possible but... Am I using this package the wrong way or is it not possible at all to paginate ?

I'm using the package on Laravel 6.9.0 and php 7.2.19

Thanks for any help !

charlie-glitch avatar Jan 03 '20 15:01 charlie-glitch

You might wanna try the forPage($page, $items) method: (https://laravel.com/docs/7.x/collections#method-forpage)

Tracker::sessions(60 * 24)->forPage(1, 20);

JefteCaro avatar Mar 03 '21 20:03 JefteCaro