Trying to create custom pagination on Laravel,
I am tring to paginate a collection build with values from two entities (users, organisations)
Is there any way to change the page number value to a custom value ?
Or can i append custom query string and value to each page url ?
you can use skip() and take() for custom pagination.
skip() will work as offset and take() will work as a limit.
ex. page = 0; offset = 0; limit = 10;
offset = page * limit;
limit = 10;
query->skip(offset)->take(limit)->get();
You can pass the values of page number & limit to your query.
Value of limit should be greater than 0
Hope this will work for you.