Grouping Routes in Laravel — a practical guide to Laravel route groups with clear examples you can reuse in real projects.
Laravel Tutorial Series (20/27). Prefer one page? Read the complete Laravel tutorial (all 27 topics).
Short description
Route groups apply shared settings (prefix, name, middleware) to many routes at once.
Prefix + name group
Route::prefix('admin')->name('admin.')->group(function () {
Route::get('/dashboard', [AdminController::class, 'dashboard'])->name('dashboard');
Route::resource('posts', AdminPostController::class);
});
// URLs: /admin/dashboard , names: admin.dashboard
Middleware group
Route::middleware(['auth', 'verified'])->group(function () {
Route::get('/profile', [ProfileController::class, 'edit']);
});
Controller group
Route::controller(PostController::class)->group(function () {
Route::get('/posts', 'index');
Route::post('/posts', 'store');
});