Answer the question
In order to leave comments, you need to log in
How to properly build laravel routes?
Good night everybody.
Help to build the right routes.
Route::get('/admin/users/', ['as' => 'adminusers','uses' => 'Admin\[email protected]']);
Route::post('/admin/users/', ['as' => 'adminuserscreate','uses' => 'Admin\[email protected]']);
Route::put('/admin/users/', ['as' => 'adminusersupdate','uses' => 'Admin\[email protected]']);
Route::delete('/admin/users/', ['as' => 'adminusersdelete','uses' => 'Admin\[email protected]']);
/admin/users - Displays all users on the system. And how to display the user for editing?
This is how it will be right?
Route::get('/admin/users/new', ['as' => 'adminusersedit','uses' => 'Admin\[email protected]']);
Answer the question
In order to leave comments, you need to log in
I think you are better off using resource controller https://laravel.com/docs/5.3/controllers#resource-...
Route::get('/admin/users/', ['as' => 'adminusers','uses' => 'Admin\[email protected]']);
Route::post('/admin/users/', ['as' => 'adminuserscreate','uses' => 'Admin\[email protected]']);
Route::get('/admin/users/{id}', ['as' => 'user.edit','uses' => 'Admin\[email protected]']);
Route::put('/admin/users/', ['as' => 'adminusersupdate','uses' => 'Admin\[email protected]']);
Route::delete('/admin/users/', ['as' => 'adminusersdelete','uses' => 'Admin\[email protected]']);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question