I have upgraded my Laravel project from 5.6 to 5.8 (in my local before deploying to live for the first time).
Both Laravel versions are 5.8.5 installed with the same composer.json
In my local, the error pages (404, 503) are the illustrated ones:
vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/illustrated-layout.blade.php
however, in live server
vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/minimal.blade.php
What is causing it? I want live to show the illustrated ones too with nice Go Back button.
Tried these but no luck :(
php artisan config:clear
php artisan cache:clear
composer dump-autoload
php artisan view:clear
php artisan route:clear
In your Laravel project folder, create a folder called “errors” in your /resources/views/ folder.
Through your config/app. php , set 'debug' => env('APP_DEBUG', false), to true . Or in a better way, check out your . env file and make sure to set the debug element to true.
Maybe late, but you could also re-publish the files from the 5.8 version without copying them from 5.7 or creating new ones:
php artisan vendor:publish --tag=laravel-errors
All blade templates should be available again under views/errors.
In the views I just had to change
@extends('errors::minimal')
into
@extends('errors::illustrated-layout')
and add
@section('image')
<div style="background-image: url({{ asset('/svg/403.svg') }});" class="absolute pin bg-cover bg-no-repeat md:bg-left lg:bg-center">
</div>
@endsection
It looks like the default 404 error view in vendor/
changed in Laravel 5.8 from the illustrated layout to the minimal layout, perhaps to have a less opinionated default.
I recommend creating your own view under resources/views/errors/404.blade.php
if you want the previous view back. You can copy the illustrated view directly from the 5.7 version if that's what you wanted to display: https://github.com/laravel/framework/blob/5.7/src/Illuminate/Foundation/Exceptions/views/404.blade.php
The illustrated layouts are still available, they're just not the default anymore.
Copying the old view is essentially the same as running php artisan vendor:publish --tag=laravel-errors
and editing the 5 lines as @Constantin noted, but since the original was only 8 lines of code to begin with it really doesn't matter which method you chose. The basic idea is the same: explicitly define your view in resources/
instead of falling back to the vendor/
defaults supplied by the framework (which may change).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With