Complete the code to name the route 'home'.
Route::get('/', function () { return view('welcome'); })->[1]('home');
In Laravel, the name method assigns a name to the route.
Complete the code to name the route 'profile.show'.
Route::get('/user/{id}', [UserController::class, 'show'])->[1]('profile.show');
The name method is used to assign a name to the route, which helps in generating URLs.
Fix the error in naming the route 'dashboard'.
Route::get('/dashboard', function () { return view('dashboard'); })->[1]('dashboard');
The correct method to name a route is name. Using named or others causes errors.
Fill both blanks to name a route group with prefix 'admin' and name prefix 'admin.'.
Route::[1](['prefix' => 'admin', 'as' => 'admin.'], function () { Route::get('/users', [AdminUserController::class, 'index'])->[2]('users.index'); });
Use group to create a route group and name to name individual routes inside it.
Fill all three blanks to define a named route with middleware and name 'profile.edit'.
Route::get('/profile/edit', [ProfileController::class, 'edit']) ->middleware('[1]') ->[2]('[3]');
Use middleware('auth') to protect the route, then name('profile.edit') to name it.
