uniqueginun's avatar

Livewire pagination issue

I'm using livewire pagination it works but sometimes I have to click twice to navigate to other page.

I swear to GOD it works fine if I cleared the log file before each click !!!!!!!!

0 likes
6 replies
Snapey's avatar

try it with the window focused before you click

Seriously, did you write your own pagination links

uniqueginun's avatar

Yes. I'm not using Laravel {{ $resource->links() }}. but I figured out the issue. basically I have special case: my app is getting the data from another server via Http requests and I get data paginated and everything but I have to hide the URL of that server from users. so I had to build custom paginator and the issue is I'm caching the data like this:

return Cache::remember('all-data', 5, function () {
        return Model::paginate(10);
    });

so the results stays the same for 5 mintues and my solution was:

return Cache::remember('all-data-' . $request->page, 5, function () {
        return Model::paginate(10);
    });
Snapey's avatar

So not something we could have IN ANY WAY helped with...

Please or to participate in this conversation.