skip to Main Content

hello I’m using backpack page manager and the auth route logout is conflicting with it

enter image description here

as u can see in the picture it’s assuming that logout is a page with a slug and trying to get its data.

I tried to exclude the ‘logout’ from the pages route slug but didn’t work

My failed attempt:

 Route::get('/{page:slug}', [SiteController::class, 'singlePage'])
    ->where('slug', '^(?!logout).*$')
    ->name('single_page');

2

Answers


  1. Please make sure Auth routes comes first.
    That’s most probably the issue.

    // Auth
    Auth::routes();
    
    ...
    
    // Pages
    Route::get('/{page:slug}', [SiteController::class, 'singlePage'])
        ->name('single_page');
    

    Side Note
    Take a look at Laravel Backpack Page Manager, it may be enough for what you need 👌

    Login or Signup to reply.
  2. I think slug should be page

    ->where('slug', '^(?!logout).*$')
    

    should be

    ->where('page', '^(?!logout).*$')
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search