Repository navigation
Is the layout.blade.php error template actually used? #55204
Replies: 2 comments
|
Your observation is correct for the error templates you linked: extending
For example, after publishing the error templates: php artisan vendor:publish --tag=laravel-errorsYou could make @extends('errors::layout')
@section('title', __('Not Found'))
@section('message', __('The requested page could not be found.'))That explicitly selects the published For customization, the practical consequence is that changing When checking this locally, use an HTML request with debug mode disabled so Laravel renders the HTTP error page rather than the development exception screen. Reference: [Laravel custom HTTP error pages](https://laravel.com/docs/12.x/errors#custom-http-error-pages). |
|
Your observation is correct. In Laravel 12.x, all eight bundled HTTP error templates (401, 402, 403, 404, 419, 429, 500 and 503) extend "errors::minimal". None of these default templates directly extends "errors::layout". However, "layout.blade.php" remains available for custom error templates that explicitly extend it. Removing it could therefore affect applications that reference it. You can publish the default error views using: php artisan vendor:publish --tag=laravel-errors Then customize the templates inside "resources/views/errors". Source: https://github.com/laravel/framework/tree/12.x/src/Illuminate/Foundation/Exceptions/views |
Uh oh!
There was an error while loading. Please reload this page.
Hi, I'd like to ask if https://github.com/laravel/framework/blob/12.x/src/Illuminate/Foundation/Exceptions/views/layout.blade.php is actually used anywhere? Because the other files in the directory (except minimal.blade.php) seem to all inherit from minimal.blade.php.
All reactions