enniosousa/server-error-pages
Laravel package that provides ready-made, customizable server error pages for common HTTP status codes. Quickly brand your 404, 500, and other error responses with clean templates instead of building each view by hand, keeping users informed when things go wrong.
Start by requiring the package via Composer and letting Laravel auto-discover the service provider:
composer require enniosousa/server-error-pages
Then publish the package's views (and config, if provided) so you can customise the error templates:
php artisan vendor:publish --provider="EnnioSousa\ServerErrorPages\ServerErrorPagesServiceProvider"
Where to look first:
config/server-error-pages.php (if published) — toggle and behaviour switches.resources/views/vendor/server-error-pages/ — the actual error page templates after publishing.First use case: replacing Laravel's default bland error pages with branded 404/500/503 screens. Once published, edit the Blade files directly — no package code changes required. Verify by hitting a non-existent route (404) and, in a staging environment, forcing a 500 (e.g. abort(500)).
APP_DEBUG=true bypasses error pages with the Ignition/Whoops stack.resources/views/layouts/app.blade.php.app/Exceptions/Handler.php (register() / render()) to map specific exception types to specific pages, rather than relying solely on status-code-based rendering.composer dump-autoload, then php artisan view:clear and php artisan config:clear, and re-verify the published views still extend the correct layout (the PSR-4 migration may have shifted the vendor view namespace).use statements, service provider registrations, or vendor:publish --provider=... commands from older docs may be stale — copy the current provider FQCN from the README.composer.json illuminate/* constraints before upgrading; pinning an older Laravel will silently keep you on v1.0.x.view and config caches will keep serving the old compiled templates. Always php artisan optimize:clear (or the individual view:clear / config:clear) after upgrading or re-publishing.APP_DEBUG=true showing the stack trace instead of your error page. Test with APP_DEBUG=false on staging.php artisan down shows your maintenance view rather than the framework default.Handler::render() first when a page "doesn't update".assertStatus(404) plus assertSee() on a branded string, so changes to the templates are covered. Force 500 via a test route throwing an exception, not by editing production code.config/server-error-pages.php and re-publishing rather than editing vendor files — vendor edits are lost on the next composer update.How can I help you explore Laravel packages today?