Laravel
- 6 ответов
- 0 вопросов
2
Вклад в тег
protected function unauthenticated($request, AuthenticationException $exception)
{
return response()->json(['message' => $exception->getMessage()], 401)
}
public function render($request, Throwable $e)
{
if ($e instanceof CustomAuthenticationException) {
return response()->json(['message' => $e->getMessage()], 401);
}
return parent::render($request, $e);
}