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

Add laravel default exception blade files to view:cache #53353

Merged
merged 4 commits into from
Oct 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@ protected function registerExceptionTracking()
*/
protected function registerExceptionRenderer()
{
$this->loadViewsFrom(__DIR__.'/../Exceptions/views', 'laravel-exceptions');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this when app.debug=false?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error page is only available with app.debug=true:
image
The views for that are cached with the namespace 'laravel-exceptions-renderer', (a few lines below the added code)

However if app.debug=false the following page is rended:
image

These views, also used for abort(404), etc. are stored in the path I added with this PR to the view:cache command, as they are always shown, independent of the app.debug value

These views can be overridden, see https://laravel.com/docs/11.x/errors#custom-http-error-pages


if (! $this->app->hasDebugModeEnabled()) {
return;
}
Expand Down