D
D
Dmitry2016-06-12 13:59:40
Laravel
Dmitry, 2016-06-12 13:59:40

How to make a 404 page in laravel 5?

I can't figure out how to display a 404 error page in laravel. The documentation says that to display your error page, you need to create it in this way resources/views/errors/404.blade.php
I created the page, but how do I make it show?
For example, if the URL does not match any of the routes, then laravel throws the error "Whoops, looks like something went wrong ...", but does not display a 404.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
Sergey Novikov, 2016-06-12
@battrack

You probably have in .env
change to false.

I
Igor, 2016-06-12
@Kraky

You can override the method renderin app/Exceptions/Handler.phpso that it only returns views with certain errors.

K
KCT, 2016-06-13
@KCT

public function notFound($value)
    {
        if (!$value) {
            abort(404);
        }
    }

N
Nikolai Shvetsov, 2016-06-17
@ShNn

You change the method in app/Exceptions/Handler.php , You make it give a certain template on a certain error

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question