antonioribeiro/tracker

Error when using paginate() on Tracker methods

charlie-glitch opened this issue · 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 !

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);