Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[9.x] Add support for 4xx/5xx fallback error views #38877

Merged
merged 2 commits into from
Sep 20, 2021
Merged

[9.x] Add support for 4xx/5xx fallback error views #38877

merged 2 commits into from
Sep 20, 2021

Conversation

SjorsO
Copy link
Contributor

@SjorsO SjorsO commented Sep 20, 2021

We can render a custom HTTP error page by creating view file for a specific status code (eg: errors/404.blade.php). This PR adds support for a fallback if the exact status code does not have a view: errors/4xx.blade.php

One of my projects has views defined for most status codes. Each view shows a helpful friendly message in Dutch. Yesterday my customer ran into a 405 error that did not have a view. This scary English error was displayed:
image

With this PR, I can create errors/4xx.blade.php and errors/5xx.blade.php views to ensure that I always render a helpful custom error page.

@taylorotwell taylorotwell merged commit 818d736 into laravel:master Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants