Irazasyed\JwtAuthGuard\JwtAuthGuard::user PHP Method

user() public method

Get the currently authenticated user.
public user ( ) : Illuminate\Contracts\Auth\Authenticatable | null
return Illuminate\Contracts\Auth\Authenticatable | null
    public function user()
    {
        if (!is_null($this->user)) {
            return $this->user;
        }
        if ($this->jwt->getToken() && $this->jwt->check()) {
            $id = $this->jwt->payload()->get('sub');
            return $this->user = $this->provider->retrieveById($id);
        }
    }