Laravel 4 Pagination Links Ignore Existing GET Parameters
I have a search in Laravel 4. After search for sh my url is this:
I also have pagination there, but the pagination for the second link for example is:
Any way to fix this?
The code you're looking for is:
$paginator->appends(['query' => $value])->links();
You can add to the query string of pagination links using the appends method on the Paginator:
<?php echo $users->appends(array('sort' => 'votes'))->links(); ?>
This will generate URLs that look something like this:
If you wish to append a "hash fragment" to the paginator's URLs, you may use the fragment method:
<?php echo $users->fragment('foo')->links(); ?>
This method call will generate URLs that look something like this:
You can also check [Laravel documentation].1
- → "failed to open stream" error when executing "migrate:make"
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS - Conditionally Load a Different Page
- → Make a Laravel collection into angular array (octobercms)
- → In OctoberCMS how do you find the hint path?
- → How to register middlewares in OctoberCMS plugin?
- → Validating fileupload(image Dimensions) in Backend Octobercms
- → OctoberCMS Fileupload completely destroys my backend
- → How do I call the value from another backed page form and use it on a component in OctoberCms