From 2dda1452fdd8d487c67350a83f92a9d6d8175803 Mon Sep 17 00:00:00 2001 From: Yurij Finiv Date: Sat, 10 Oct 2026 21:47:33 +0300 Subject: [PATCH] Match admin error presentation to authentication and failure severity --- resources/views/errors/admin-shell.blade.php | 79 ++++++++++---------- resources/views/errors/page.blade.php | 4 +- src/Exceptions/AdminErrorPages.php | 5 ++ tests/Feature/AdminErrorPagesTest.php | 23 ++++++ 4 files changed, 71 insertions(+), 40 deletions(-) diff --git a/resources/views/errors/admin-shell.blade.php b/resources/views/errors/admin-shell.blade.php index 3b52839..7400dc4 100644 --- a/resources/views/errors/admin-shell.blade.php +++ b/resources/views/errors/admin-shell.blade.php @@ -1,46 +1,49 @@ @php - $errors = [ - 401 => ['Authentication required', 'Sign in to continue to the admin area.'], - 403 => ['Access denied', 'You do not have permission to view this page.'], - 404 => ['Page not found', 'This admin page may have been moved, deleted, or never existed.'], - 419 => ['Session expired', 'Your session has expired. Refresh the page to continue.'], - 429 => ['Too many requests', 'Please wait a moment before trying again.'], + $pages = [ + 403 => [ + 'title' => 'Access denied', + 'eyebrow' => 'RESTRICTED ACCESS', + 'message' => 'You do not have permission to access this section.', + 'hint' => 'If you need access, contact an administrator.', + ], + 404 => [ + 'title' => 'Page not found', + 'eyebrow' => 'PAGE UNAVAILABLE', + 'message' => 'We could not find the admin page you requested.', + 'hint' => 'The address may be incorrect, or the page may have been moved.', + ], ]; - [$errorTitle, $errorMessage] = $errors[$status] ?? $errors[404]; + $page = $pages[$status] ?? $pages[404]; @endphp - - {{-- Keep the central error illustration independent from host Vite builds. --}} - -
-
-