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
Post a Comment