Create a gist now

Instantly share code, notes, and snippets.

Laravel53-passport-server/routes/api.php
Route::group(['prefix' => '/user', 'middleware' => 'auth:api'], function (){
Route::get('/', function (Request $request) {
return $request->user();
});
Route::get('/facebook_information', function (Request $request) {
return "Hello " . $request->user()->name . " got Facebook information!";
})->middleware('scope:Facebook_information');
Route::get('/facebook_github_information', function (Request $request) {
return "Hello " . $request->user()->name . " got Facebook&GitHub information!";
})->middleware('scopes:Facebook_information,GitHub_information');
Route::get('/facebook_twitter_information', function (Request $request) {
return "Hello " . $request->user()->name . " got Facebook&Twitter information!";
})->middleware('scopes:Facebook_information,Twitter_information');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment