S
S
seredaes2017-01-30 02:07:32
Laravel
seredaes, 2017-01-30 02:07:32

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

3 answer(s)
A
Alexander Melikhov, 2017-01-30
@amelihovv

I think you are better off using resource controller https://laravel.com/docs/5.3/controllers#resource-...

H
hopeful_romantic, 2017-01-30
@hopeful_romantic

46ff828b77514fe1a8dca1041028489a.png

I
Igor Karachentsev, 2017-01-30
@kucheriavij

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 question

Ask a Question

731 491 924 answers to any question