Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

twiggy99's avatar

GET params are empty and its stopping the pagination from working

I have the following route set-up:

Route::namespace('Admin')->prefix('admin')->name('admin.')->middleware(['auth', 'auth.admin'])->group(function () {

    Route::prefix('users')->group(function() {
    Route::get('', 'UserController@index')->name('user');
    Route::get('/view/{id}', 'UserController@view')->name('user.view');
    Route::get('/edit/{id}', 'UserController@edit')->name('user.edit');
    Route::get('/delete/{id}', 'UserController@delete')->name('user.delete');
    Route::post('/update', 'UserController@update')->name('user.update');
    });

I can now hit this page to show the Index method on the \Admin\UserController http://localhost:8050/admin/users this works fine and gets the users in a paginated form. When I click the pagination links the page refreshes but the data stays the same.

After some digging my GET params are empty, even when I pass the page key directly in the URL like so: http://localhost:8050/admin/users?page=2 my GET params are empty so that's why the pagination isn't working but whats blocking the GET params from getting through?

Even doing a dd($_GET) shows the GET params as being empty.

0 likes
3 replies
jlrdw's avatar

You have to pass the query string through controller to view, and append the query string.

controller:

$params = array('psch' => $dogsearch, 'aval' => $aval);

params passed with a with statement to view:

->with('params', $params);

In view:

echo '<td>' . $dogs->appends($params)->links() . '</td>';

Just convert to blade if needed, I think:

{{ $dogs->appends($params)->links() }}

If only parameters, you have to pass each time through the route, and the query string will just hold the page number.

site/myparam1/myparam2?page=2

Parameters passed via route ARE NOT the same as query string parameters.

querystring
site/whatever?avar=hello&bvar=world&page=2


NOT querystring
site/whatever/hello/world?page=2

Before proceeding you may want to study up on difference in parameters and query string usage in laravel or just in general.

Just a suggestion.

Snapey's avatar

Something wrong with your htaccess file. Have you changed it at all? Is it non-standard?

munazzil's avatar

Can you type below command in your cmd and display output.

php artisan route:list

Please or to participate in this conversation.