Route::resource
snippet in c

Route::resource('/posts','PostController');

user3511

Route::resources([
    'photos' => 'PhotoController',
    'posts' => 'PostController',
]);

Route::resource

user2323

php artisan make:controller PhotoController --resource

Route::resource

user2141

Route::resource('photos', PhotoController::class)->only([
    'index', 'show'
]);

Route::resource('photos', PhotoController::class)->except([
    'create', 'store', 'update', 'destroy'
]);

Route::resource

user3046

Route::resource('photos', PhotoController::class);