I'm creating a small application using Laravel 5.6
, however, I'm having trouble determining the route nomenclature, or rather to determine whether or not I use resource Controller
.
I currently have these routes:
Route::get('/alterar-senha','Painel\AlterarSenhaController@index')
->name('alterar-senha');
Route::post('/alterar-senha','Painel\AlterarSenhaController@alterarSenha')
->name('alterar-senha');
Would it be relevant to use resource Controller
to improve the aesthetics of my route files?
Note: I will still have other routes like change-email
I thought about:
Route::resource('alterar-senha', 'Painel\AlterarSenhaController')
->only(['edit', 'update']);
The route to change emails followed the same approach. When using resource
instead of having 4 lines, have only 2 and visually a structure more pleasing to the eye, but would this approach really be valid?