laravel 5.1 Auth::check() 500 internal server error afterJWTAuth::attempt($credentials) login
<p>I am creating login api in <strong>laravel 5.1</strong>.</p>

<p>I have created user authentication in controller </p>

<pre><code>    try {

        // verify the credentials and create a token for the user

        if (! $token = JWTAuth::attempt($credentials)) {
            $response['error'] = 'true';
            $response['data'] = 'invalid_credentials';
            return response()-&gt;json($response);
        }

    } catch (JWTException $e) {
        // something went wrong
        $response['error'] = 'true';
        $response['data'] = 'could_not_create_token';
        return response()-&gt;json($response);
    }

    $response['error'] = 'false';

    $response['data'] = ['token'=&gt;$token];
    return response()-&gt;json($response);
</code></pre>

<p>It is working, and successfully generating token.</p>

<p>but in this code before return, if check login <code>dd(Auth::check());</code>
It throws </p>

<blockquote>
  <p>Status 500 Internal Server Error </p>
</blockquote>

<p>Then here, How can I get user from database after successful login?</p>