Example 1: laravel route resources
Route::resource('photos', PhotoController::class); Route::resources([ 'photos' => PhotoController::class, 'posts' => PostController::class, ]); php artisan make:controller PhotoController --resource --model=Photo
Example 2: how to named route resource laravel
Route::resource('faq', 'ProductFaqController', [ 'names' => [ 'index' => 'faq', 'store' => 'faq.new', ] ]);
Example 3: Route::resource
php artisan make:controller PhotoController --resource
Example 4: Route::resource
Route::resource('photos', PhotoController::class);
Comments
Post a Comment