Hello all,
So I’ve setup a Livewire component that acts as infinite scrolling using pagination, it makes use of Livewire’s built-in functionality, I’m just wondering how would I go about getting the last page? I know Laravel has a method for it but I’m looking at Livewire’s WithPagination trait and I’m not seeing one. I’m not using actual links in my view either so I can’t really make use of the hasMorePages()
method. I have some JS code that detects whether to go forward or back.
https://laravel.com/docs/7.x/pagination
Edit: The only thing I can think of is having some custom property that calculates the total number of pages based on how many results are shown.