/** * Ensure that a token is available in the request. * * @throws \Tymon\JWTAuth\Exceptions\JWTException * * @return \Tymon\JWTAuth\JWT */ protected function requireToken() { if (!$this->jwt->getToken()) { throw new JWTException('Token could not be parsed from the request.'); } return $this->jwt; }
/** * @param \Tymon\JWTAuth\Manager $manager * @param \Tymon\JWTAuth\Contracts\Providers\Auth $auth * @param \Tymon\JWTAuth\Http\Parser $parser */ public function __construct(Manager $manager, Auth $auth, Parser $parser) { parent::__construct($manager, $parser); $this->auth = $auth; }
/** * Get the raw Payload instance. * * @return \Tymon\JWTAuth\Payload */ public function getPayload() { return $this->jwt->getPayload(); }