From dbfe8751d6326aeb6d9d3c4879e50e14d4fb7d6c Mon Sep 17 00:00:00 2001 From: omair saleh Date: Thu, 30 Sep 2021 14:19:34 +0800 Subject: [PATCH] fix user routes and add middleware for logged in user --- routes/account.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/routes/account.php b/routes/account.php index 2da67709..1a05eb0d 100644 --- a/routes/account.php +++ b/routes/account.php @@ -10,14 +10,6 @@ Route::group(['prefix' => 'account', 'namespace' => 'Accounts', 'as' => 'account Route::group(['middleware' => 'valid.token'], function () { Route::get('/logout', 'UserAuthenticationLogoutController@logout')->name('logout'); Route::get('/refresh', 'RefreshAuthenticationTokenController@refresh')->name('refresh'); - Route::group(['prefix' => 'user', 'as' => 'user.'], function () { - Route::post('/show', 'FetchUserController@fetch')->name('show'); - Route::get('/list', 'ListUsersController@list')->name('list'); - Route::put('/update/{id}', 'UpdateUserController@update')->name('update'); - - Route::post('/admin/create', 'CreateAdminUserController@create')->name('admin.create'); - Route::delete('/delete/{id}', 'DeleteUserController@delete')->name('delete'); - }); }); Route::group(['prefix' => 'login', 'as' => 'authenticate.'], function () { @@ -41,6 +33,15 @@ Route::group(['prefix' => 'account', 'namespace' => 'Accounts', 'as' => 'account Route::post('/verification/resend', 'ResendEmailVerificationController@resend')->name('verification.resend'); }); + Route::group(['prefix' => 'user', 'as' => 'user.', 'middleware' => 'valid.token'], function () { + Route::post('/show', 'FetchUserController@fetch')->name('show'); + Route::get('/list', 'ListUsersController@list')->name('list'); + Route::put('/update/{id}', 'UpdateUserController@update')->name('update'); + + Route::post('/admin/create', 'CreateAdminUserController@create')->name('admin.create'); + Route::delete('/delete/{id}', 'DeleteUserController@delete')->name('delete'); + }); + }); \ No newline at end of file