Last active
February 7, 2020 15:37
-
-
Save godilite/a093ad78be1ec7e761f11948b5400036 to your computer and use it in GitHub Desktop.
API Routes for Laravel API. Notice that there is an auth middleware on logout 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 | |
use Illuminate\Http\Request; | |
/* | |
|-------------------------------------------------------------------------- | |
| API Routes | |
|-------------------------------------------------------------------------- | |
| | |
| Here is where you can register API routes for your application. These | |
| routes are loaded by the RouteServiceProvider within a group which | |
| is assigned the "api" middleware group. Enjoy building your API! | |
| | |
*/ | |
Route::group(['prefix' => 'v1'], function () { | |
Route::post('/login', 'UsersController@login'); | |
Route::post('/register', 'UsersController@register'); | |
Route::get('/logout', 'UsersController@logout')->middleware('auth:api'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment