Route::resource code example
Example 1: Route::resource('/posts','PostController');
Route::resources([
'photos' => 'PhotoController',
'posts' => 'PostController',
]);
Example 2: Route::resource
php artisan make:controller PhotoController --resource
Example 3: Route::resource
Route::resource('photos', PhotoController::class)->only([
'index', 'show'
]);
Route::resource('photos', PhotoController::class)->except([
'create', 'store', 'update', 'destroy'
]);
Example 4: Route::resource
Route::resource('photos', PhotoController::class);