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

Conversation

SamuelWei
Copy link
Contributor

@SamuelWei SamuelWei commented Oct 30, 2024

Fixes #53336

This PR adds the path of the default exception blade views to the view:cache command

@SamuelWei SamuelWei changed the title Create cache for laravel default exception blade files Add laravel default exception blade files to view:cache Oct 30, 2024
@@ -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

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.

Default execptions are not precompiled using view:cache
3 participants