Complete the code to register a resource route for the 'posts' controller.
Route::[1]('posts', PostController::class);
The resource method registers all standard resource routes for a controller in Laravel.
Complete the code to limit resource routes to only 'index' and 'show' methods.
Route::resource('products', ProductController::class)->[1](['index', 'show']);
The only method restricts the resource routes to specified actions.
Fix the error in the code to register resource routes with a custom parameter name.
Route::resource('users', UserController::class)->parameters(['users' => '[1]']);
The parameter name should be singular and match the route parameter used in the controller methods.
Fill both blanks to register resource routes with a custom route name prefix and only 'create' and 'store' methods.
Route::resource('orders', OrderController::class)->[1](['create', 'store'])->names(['create' => '[2]']);
Use only to limit methods and names to customize route names.
Fill all three blanks to register resource routes with a middleware group, custom parameter, and route names.
Route::middleware('[1]')->resource('comments', CommentController::class)->parameters(['comments' => '[2]'])->names(['index' => '[3]']);
Use auth middleware to protect routes, singular comment as parameter, and custom route name comments.index.