From 876b81d8f64574dd0144d6ea7587aaf1e48551d8 Mon Sep 17 00:00:00 2001 From: Yoga Pangestu Date: Mon, 29 Jun 2026 10:10:54 +0700 Subject: [PATCH] fix: ensure JSON exceptions are rendered when the request expects a JSON response --- bootstrap/app.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap/app.php b/bootstrap/app.php index fc6932e..6bae236 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -35,7 +35,7 @@ }) ->withExceptions(function (Exceptions $exceptions): void { $exceptions->shouldRenderJsonWhen( - fn (Request $request) => $request->is('api/*'), + fn (Request $request) => $request->is('api/*') || $request->expectsJson(), ); }) ->withSchedule(function (Schedule $schedule): void {