Route::resource('photo', 'PhotoController');
//GET /photos index
//GET /photos/create create
//POST /photos store
//GET /photos/{photo} show
//GET /photos/{photo}/edit edit
//PUT/PATCH /photos/{photo} update
//DELETE /photos/{photo} destroy
The corresponding route names are:
photo.index
photo.create
photo.store
photo.show
photo.edit
photo.destory
Assume the domain name is: www.longlongago.top
www.longlongago.top/photos
How to get its routing name photo.index
based on
Laravel uses the restful architecture style. If you are not sure about it, you can check it online.
resource is a resource route that can point to the corresponding method under the controller according to the request method
For example: directly access the URL www.longlongago.top/photos, first determine that this is a get request, so the program will The default method to find index
Route::currentRouteName()