Support the ongoing development of Laravel.io →
posted 8 years ago
Configuration

I wanna shows the route errors when I work on my local.

My code in App\Exceptions\handler.php

I tried:

public function render($request, Exception $exception)
    {
        if ($this->isHttpException($exception) && env('APP_DEBUG') === false) {
            return response()->view('errors.404', [], 404);
        } else {
            return parent::render($request, $exception);
        }
    }

or

public function render($request, Exception $exception)
    {
        if ($this->isHttpException($exception) && \App::environment('local') === false) {
            return response()->view('errors.404', [], 404);
        } else {
            return parent::render($request, $exception);
        }
    }

But is not working.

Last updated 2 years ago.
0

maybe you need to set this:

use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;

in the handle.php

see this link, it's about error pages.

Last updated 8 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

seruves seruves Joined 13 Dec 2016

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.