Duke_Reno's avatar

Changing Laravel Pagination next/previous PageUrl

So i have 3 paginated catalogs, which are in order, lets say:

x= 3 pages; y= 2 pages; z= 6 pages;

What i want is, if you are in the last page of "x" or "y" catalogs, then instead of having a "NULL" for next page url, i want to set it to the first page of the next catalog so if:

(x->CurrentPage()==3){ x->setNextPageUrl(y); //this "setter" is just an example }

And also backwards, so if im in the first page of y, then if:

(y->currentPage()==1){ y->setPreviousPageUrl(x->lastPage()); }

Is there a way i can do this with an already created method/function or do i have to find a way around?

thanks

0 likes
0 replies

Please or to participate in this conversation.