How to display the laravel 404 page?

Viewed 524

I am still new in using laravel. For the first project that I tried, the 404 page error that shows up is the 404 page provided in laravel. Laravel's 404 page

But for my second project, the 404 page is showing up the old 404 page. Old 404 page

I'm not sure what changes I did that led to it. Is there a way to know? How do I change it so that it will show the 404 page made by laravel?

1 Answers

The default 404 error page moved to minimal design in Laravel 5.8

So you can grab the 5.7 one from here

And override it by placing a resources/views/errors/404.blade.php file containing

@extends('errors::illustrated-layout')

@section('code', '404')
@section('title', __('Page Not Found'))

@section('image')
    <div style="background-image: url({{ asset('/svg/404.svg') }});" class="absolute pin bg-cover bg-no-repeat md:bg-left lg:bg-center">
    </div>
@endsection

@section('message', __('Sorry, the page you are looking for could not be found.'))

And get the public/svg/404.svg file from here if you don't have it already and place it in public/svg folder

Related