Laravel Code Completion Easy +10 XP
Auth Middleware
Complete the route middleware for authentication.
LaravelFill in the blank
Route::___('auth')->group(function() {
Route::get('/dashboard', [DashboardController::class, 'index']);
});Type the missing code
Show answer and explanation
Answer: middleware
Route::middleware('auth') protects routes so only authenticated users can access them.
Hint: Which method applies middleware to routes?
What this challenge tests
Code Completion in Laravel: middleware, auth.