Route::group(['prefix' => 'admin', 'middleware' => 'admin', 'namespace' => 'Admin'], function () {
Route::resource("consentforms","ConsentformController");
});
とするとルート名は
| GET|HEAD | admin/consentforms/create | consentforms.create |
| GET|HEAD | admin/consentforms/{consentform} | consentforms.show |
| PUT|PATCH | admin/consentforms/{consentform} | consentforms.update |
... (以下続く)
と、なりますが
次の様に 'as' => 'admin.' を使うと 名前の先頭に admin. が追加されます
Route::group(['prefix' => 'admin', 'middleware' => 'admin', 'namespace' => 'Admin', 'as' => 'admin.'], function () {
Route::resource("consentforms","ConsentformController");
});
↓ この様なルート名になります
| GET|HEAD | admin/consentforms/create | admin.consentforms.create |
| GET|HEAD | admin/consentforms/{consentform} | admin.consentforms.show |
| PUT|PATCH | admin/consentforms/{consentform} | admin.consentforms.update |
... (以下続く)