public function renewToken(?Token $token) : Token
    {
        if ($token === null) {
            throw new NullValueException("Token cannot be null");
        }

        $token->updateExisting([
            'token' => $this->generateToken($this->config->get('app.key')),
        ]);

        $this->fireUpdatedEvent($token->user, $token);

        return $token;
    }
public function renewToken(?Token $token) : Token
    {
        if ($token === null) {
            throw new NullValueException("Token cannot be null");
        }

        $token->updateExisting([
            'token' => $this->generateToken($this->config->get('app.key')),
        ]);

        $this->fireUpdatedEvent($token->user, $token);

        return $token;
    }
public function renewToken ( ? Token $ token ) : Token { if ( $ token === null ) { throw new NullValueException ( "Token cannot be null" ) ; } $ token -> updateExisting ( [ 'token' => $ this -> generateToken ( $ this -> config -> get ( 'app.key' ) ) , ] ) ; $ this -> fireUpdatedEvent ( $ token -> user , $ token ) ; return $ token ; }
Renew a token

@param \Laranix\Auth\User\Token\Token|null $token
@return \Laranix\Auth\User\Token\Token|\Laranix\Support\Database\Model
@throws \Laranix\Support\Exception\NullValueException
Renew a token