1 year ago

GET params are empty and its stopping the pagination from working

Posted 1 year ago by twiggy99

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('', '[email protected]')->name('user');
    Route::get('/view/{id}', '[email protected]')->name('user.view');
    Route::get('/edit/{id}', '[email protected]')->name('user.edit');
    Route::get('/delete/{id}', '[email protected]')->name('user.delete');
    Route::post('/update', '[email protected]')->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.

Please sign in or create an account to participate in this conversation.