Level 75
Of course it's not possible, add prefix for your routes.
Routes work from top to bottom.
When you visit /dashboard you always get dashbord from RegistrarController.
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have 7 routes with the same URI but different named routes. They don't work unless I change the URI. Is there a way to have the same URI in Laravel?
Route::get('/dashboard',[RegistrarController::class, 'getDashboard'])->name('registrar.dashboard')->middleware('auth','registrar','verified');
Route::get('/dashboard', [WebmasterController::class, 'getDashboard'])->name('webmaster.dashboard')->middleware('auth','webmaster','verified');
Route::get('/dashboard', [TeamController::class, 'getDashboard'])->name('team.dashboard')->middleware('auth','team','verified');
Route::get('/dashboard', [PastorController::class, 'getDashboard'])->name('pastor.dashboard')->middleware('auth','pastor','verified');
Route::get('/dashboard', [SponsorController::class, 'getDashboard'])->name('sponsor.dashboard')->middleware('auth','sponsor','verified');
Route::get('/dashboard', [PilgrimController::class, 'getDashboard'])->name('pilgrim.dashboard')->middleware('auth','pilgrim','verified');
Route::get('/dashboard', [UserController::class, 'getDashboard'])->name('user.dashboard')->middleware('auth','user','verified');
Of course it's not possible, add prefix for your routes.
Routes work from top to bottom.
When you visit /dashboard you always get dashbord from RegistrarController.
Please or to participate in this conversation.