feat: Inertia profile settings page, Studio edit redesign, EGS, Nova UI components\n\n- Redesign /dashboard/profile as Inertia React page (Settings/ProfileEdit)\n with SettingsLayout sidebar, Nova UI components (TextInput, Textarea,\n Toggle, Select, RadioGroup, Modal, Button), avatar drag-and-drop,\n password change, and account deletion sections\n- Redesign Studio artwork edit page with two-column layout, Nova components,\n integrated TagPicker, and version history modal\n- Add shared MarkdownEditor component\n- Add Early-Stage Growth System (EGS): SpotlightEngine, FeedBlender,\n GridFiller, AdaptiveTimeWindow, ActivityLayer, admin panel\n- Fix upload category/tag persistence (V1+V2 paths)\n- Fix tag source enum, category tree display, binding resolution\n- Add settings.jsx Vite entry, settings.blade.php wrapper\n- Update ProfileController with JSON response support for API calls\n- Various route fixes (profile.edit, toolbar settings link)"
This commit is contained in:
@@ -23,5 +23,72 @@ return Application::configure(basePath: dirname(__DIR__))
|
||||
]);
|
||||
})
|
||||
->withExceptions(function (Exceptions $exceptions): void {
|
||||
//
|
||||
|
||||
// ── 404 / 410 / 403 — web HTML responses only ─────────────────────────
|
||||
$exceptions->render(function (
|
||||
\Symfony\Component\HttpKernel\Exception\HttpException $e,
|
||||
\Illuminate\Http\Request $request
|
||||
) {
|
||||
if ($request->expectsJson()) {
|
||||
return null; // Let Laravel produce the default JSON response.
|
||||
}
|
||||
|
||||
$status = $e->getStatusCode();
|
||||
|
||||
// 403 and 401 use their generic Blade views — no extra data needed.
|
||||
if ($status === 403) {
|
||||
return response(view('errors.403', ['message' => $e->getMessage() ?: null]), 403);
|
||||
}
|
||||
if ($status === 401) {
|
||||
return response(view('errors.401'), 401);
|
||||
}
|
||||
if ($status === 410) {
|
||||
return response(view('errors.410'), 410);
|
||||
}
|
||||
|
||||
// Generic 404 — smart URL-pattern routing to contextual views.
|
||||
if ($status === 404) {
|
||||
return app(\App\Http\Controllers\Web\ErrorController::class)
|
||||
->handleNotFound($request);
|
||||
}
|
||||
|
||||
return null; // Fallback to Laravel's default.
|
||||
});
|
||||
|
||||
// ── ModelNotFoundException → contextual 404 on web ───────────────────
|
||||
$exceptions->render(function (
|
||||
\Illuminate\Database\Eloquent\ModelNotFoundException $e,
|
||||
\Illuminate\Http\Request $request
|
||||
) {
|
||||
if ($request->expectsJson()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return app(\App\Http\Controllers\Web\ErrorController::class)
|
||||
->handleNotFound($request);
|
||||
});
|
||||
|
||||
// ── 500 server errors — log with correlation ID ───────────────────────
|
||||
$exceptions->render(function (
|
||||
\Throwable $e,
|
||||
\Illuminate\Http\Request $request
|
||||
) {
|
||||
if ($request->expectsJson()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Only handle truly unexpected server errors (not HTTP exceptions already handled above).
|
||||
if ($e instanceof \Symfony\Component\HttpKernel\Exception\HttpException) {
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
$correlationId = app(\App\Services\NotFoundLogger::class)->log500($e, $request);
|
||||
} catch (\Throwable) {
|
||||
$correlationId = 'UNKNOWN';
|
||||
}
|
||||
|
||||
return response(view('errors.500', ['correlationId' => $correlationId]), 500);
|
||||
});
|
||||
|
||||
})->create();
|
||||
|
||||
Reference in New Issue
Block a user