When you create a controller, https://laravel.com does provide you with the route resource which provides out of the box CRUD operation routes. You can check these named routes by the following command: php artisan route:list By default, following is the list of the photos controller CRUD operation routes: Verb Action Route Name /photos index photos.index /photos/create index photos.index /photos index photos.index /photos/{photo} index photos.index /photos/{photo}/edit index photos.index /photos index photos.index /photos index photos.index Sometimes, we may want to use only few of the routes from the CRUD operation and let's say we want to use only index, create, store, edit and update, we can customise it like the following: Route::resource('photos', 'PhotoController')->only('index', 'create', 'store', 'edit', 'update'); We can also specify the as option to define a prefix for every route name. Route::resource('photos', 'PhotoController', [ 'as' => 'foo' ]); Similarly, you can also provide a custom name for each controller methods like the following: Route::resource('photos', 'PhotoController', [ 'names' => [ 'index' => 'foo', 'store' => 'foo.new', // etc... ]]);
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners