php - Laravel 5.4 Combined Api route group with auth middleware? -


how combine api route group auth have this:

route::group(['middleware' => 'auth'], function () {     ...  }); 

thus if call default api route:

route::middleware('auth:api')->get('/user', function (request $request) {       return $request->user();  });  app/api/user 

i no return value.

i new api routes doing wrong.

i not found tutorial api laravel 5.4

route::middleware('auth:api')->get('/user', function () {       return auth::user();  }); 

or

route::get('/user', function () {           return auth::user();  })->middleware('auth'); 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -