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.
maybe you need to set this:
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
in the handle.php
see this link, it's about error pages.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community