fix: ensure JSON exceptions are rendered when the request expects a JSON response

This commit is contained in:
Yoga Pangestu 2026-06-29 10:10:54 +07:00
parent 39c8bd01a8
commit 876b81d8f6

View File

@ -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 {