# Routing
Estimated time: 7 minutes
Difficulty: Intermediate
Routing in LaraCoreKit combines global Laravel routes with module-specific routes.
Route Sources
routes/web.php- global routesroutes/api.php- global API routesmodules/*/src/routes/web.php- module web routesmodules/*/src/routes/api.php- module API routes
Module Route Loading
Module providers load their own routes:
$this->loadRoutesFrom(__DIR__.'/routes/web.php');
This keeps routes close to feature code.
Recommended Route Conventions
Public web routes
Route::get('/blog', [BlogController::class, 'index'])->name('blog.index');
Protected routes
Route::middleware(['auth'])->group(function () {
Route::get('/dashboard', DashboardController::class)->name('dashboard');
});
API routes
Route::middleware('auth:sanctum')->group(function () {
Route::get('/profile', [ProfileController::class, 'show']);
});
Route Naming
Use consistent names to avoid conflicts:
blog.indexblog.showuser.profile.editsettings.general.update
Prefer module-prefixed route names.
Route Caching
Production:
php artisan route:cache
After route changes:
php artisan route:clear
Debugging Routes
List routes:
php artisan route:list
Filter by module/prefix:
php artisan route:list --name=blog
php artisan route:list --path=admin
Next Steps
Next: Middleware →