repository = $repository; } /** * @param string $token * @return bool * @throws ResourceNotFoundException */ public function execute(string $token){ if(!$this->repository->active()->where('token', $token)->first()){ throw new ResourceNotFoundException('The email verification token has expired or doesn\'t exist'); } return true; } }