/** * Check the request for the presence of a token * * @throws \Symfony\Component\HttpKernel\Exception\BadRequestHttpException */ public function checkForToken() { if (!JWTAuth::parser()->setRequest($this->request)->hasToken()) { throw new BadRequestHttpException('Token not provided'); } }