0
I am creating a small application using the Laravel 5.6
, however, I’m having difficulty 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');
It would be relevant to use resource Controller
to improve the aesthetics of my route files?
Observing: I’ll still have other routes like change-email
I thought about:
Route::resource('alterar-senha', 'Painel\AlterarSenhaController')
->only(['edit', 'update']);
The route to change email followed the same approach. When using resource
with you instead of having 4 lines, having only 2 and visually a more pleasing structure to the eye, but this approach would really be valid?