Created
September 4, 2018 14:22
-
-
Save Artistan/566f2d971088af2c811ade2aaa51c462 to your computer and use it in GitHub Desktop.
Laravel API routes
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 auth routes... | |
Route::group(['middleware' => ['auth:api']], function () { | |
// unversioned api routes | |
Route::get('/user', function (Request $request) { | |
return $request->user(); | |
}); | |
// version 1 | |
Route::group(['prefix' => 'v1'], function () { | |
Route::apiResource('documents', 'DocumentsController'); | |
}); | |
}); |
Author
Artistan
commented
Sep 4, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment