expires_at <= time()) { throw new TokenHasExpiredException(); } if ($this->revoked) { throw new TokenHasRevokedException(); } return true; } /** * @param $uniacid * @param $token * @return bool * @throws TokenHasExpiredException * @throws TokenHasRevokedException * @throws TokenNotFoundException */ static public function verify($uniacid, $token) { $accessToken = self::where([ 'uniacid' => $uniacid, 'access_token' => $token, ])->first(); if (!$accessToken) { throw new TokenNotFoundException(); } return $accessToken->valid(); } }