Last active
April 12, 2021 22:32
-
-
Save farindra/5188e8fc3f39cc86c50fab2a9a919cf3 to your computer and use it in GitHub Desktop.
Lumen user route
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* registration */ | |
$router->post('/register', [ 'as' => 'register', 'uses' => 'AuthController@register']); | |
/* login */ | |
$router->post('/login', [ 'as' => 'login', 'uses' => 'AuthController@login']); | |
/* restrict route */ | |
$router->group(['middleware' => 'auth'], function () use ($router) { | |
/* get user profile */ | |
$router->get('/profile', [ 'as' => 'profile', 'uses' => 'AuthController@profile']); | |
/* logout user */ | |
$router->get('/logout', [ 'as' => 'logout', 'uses' => 'AuthController@logout']); | |
/* refresh token */ | |
$router->get('/refresh-token', [ 'as' => 'refreshToken', 'uses' => 'AuthController@refresh']); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment