Authentication

    Getting Started

    Authentication Service Provider

    Again, you may retrieve the authenticated user however you wish. You may use an API token in the request headers or query string, a bearer token on the request, or using any other approach your application requires.

    Accessing The Authenticated User

    Just like in the full Laravel framework, you may use the Auth::user() method to retrieve the current user. Alternatively, you may use the $request->user() method on an Illuminate\Http\Request instance:

    Of course, any routes you wish to authenticate should be assigned the auth , so you should uncomment the call to $app->routeMiddleware() in your bootstrap/app.php file: