GenTux\Jwt\JwtToken::setToken PHP Метод

setToken() публичный Метод

Set the current JWT token
public setToken ( string $token ) : self
$token string
Результат self
    public function setToken($token)
    {
        $this->token = $token;
        return $this;
    }

Usage Example

Пример #1
0
 /**
  * Create a new JWT token object from the token in the request
  *
  * @param Request|null $request
  *
  * @return JwtToken
  *
  * @throws NoTokenException
  */
 public function jwtToken($request = null)
 {
     $token = $this->getToken($request);
     if (!$token) {
         throw new NoTokenException('JWT token is required.');
     }
     $driver = $this->makeDriver();
     $jwt = new JwtToken($driver);
     $jwt->setToken($token);
     return $jwt;
 }
All Usage Examples Of GenTux\Jwt\JwtToken::setToken