Laravel Route Groups and Prefixes
January 16, 2026
•
1 min read
•
27 views
Table of Contents
Route organization:
Route Groups
Route::middleware(['auth'])->group(function () {
Route::get('/dashboard', DashboardController::class);
});
Prefix
Route::prefix('admin')->group(function () {
Route::get('/users', [AdminController::class, 'users']);
});
Name Prefix
Route::name('admin.')->group(function () {
Route::get('/users', ...)->name('users');
});
Combined
Route::prefix('api/v1')
->middleware('api')
->name('api.v1.')
->group(function () {
// Routes
});
Related Posts
Laravel Sanctum API Authentication Complete Guide
Build secure API authentication with Laravel Sanctum for SPAs and mobile apps.
Laravel Rate Limiting: Protect Your Application
Implement rate limiting to protect your Laravel application from abuse.
Laravel Blade Components: Build Reusable UI
Create powerful reusable components with Laravel Blade.
Comments (0)
No comments yet. Be the first to comment!