Ejemplo n.º 1
0
 /**
  * Get the currently authenticated user.
  *
  * @return \Illuminate\Contracts\Auth\Authenticatable|null
  */
 public function user()
 {
     if (!is_null($this->user)) {
         return $this->user;
     }
     if (!$this->requireToken()->check()) {
         return null;
     }
     $id = $this->jwt->getPayload()->get('sub');
     return $this->user = $this->provider->retrieveById($id);
 }
Ejemplo n.º 2
0
 /**
  * Get the raw Payload instance.
  *
  * @return \Tymon\JWTAuth\Payload
  */
 public function getPayload()
 {
     return $this->jwt->getPayload();
 }