$uniacid, 'refresh_token' => $token, ])->first(); if (!$refreshToken) { throw new TokenNotFoundException(); } return $refreshToken->valid(); } /** * @return bool * @throws TokenHasExpiredException * @throws TokenHasRevokedException */ public function valid() { if ($this->expires_at <= time()) { throw new TokenHasExpiredException(); } if ($this->revoked) { throw new TokenHasRevokedException(); } return true; } }