Complete the code to start a route group with the prefix 'admin'.
Route::[1](['prefix' => 'admin'], function () { // routes here });
The group method starts a route group with shared attributes like prefix.
Complete the code to add a middleware 'auth' to a route group.
Route::group(['middleware' => [1]], function () { // protected routes });
The 'auth' middleware protects routes by requiring user authentication.
Fix the error in the route group to correctly set both prefix and middleware.
Route::group([1], function () {
// routes
});The array keys and string values must be quoted correctly for PHP syntax.
Fill both blanks to create a route group with prefix 'api' and middleware 'auth:api'.
Route::group(['[1]' => 'api', '[2]' => 'auth:api'], function () { // api routes });
The 'prefix' key sets the URL prefix, and 'middleware' applies the auth guard.
Fill all three blanks to create a route group with prefix 'admin', middleware 'auth', and namespace 'Admin'.
Route::group(['[1]' => 'admin', '[2]' => 'auth', '[3]' => 'Admin'], function () { // admin routes });
The keys 'prefix', 'middleware', and 'namespace' set URL prefix, middleware, and controller namespace respectively.