More detailed on StackOverflow.
Open up app\Http\Kernel.php
and change the content in the handle
method to this:
try
{
return parent::handle($request);
}
catch(\Symfony\Component\HttpKernel\Exception\NotFoundHttpException $e)
{
return $this->app->make('Illuminate\Routing\ResponseFactory')->view('error.404', [], 404);
}
catch (Exception $e)
{
throw $e;
}
This will catch 404 Not Found exceptions and display the view file error/404.blade.php
.
I believe this is the way in Laravel 5 to catch exceptions.
@Marwelln thanks
yes that's a better way to handle this then what i did, what i did basically redirect any page errors not just 404 to index. this way at-least it will let us control which page to deploy for each types of errors.
i am gonna use this for now, i am assuming even this will change in few days hehe.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community