framework icon indicating copy to clipboard operation
framework copied to clipboard

Handling missing routes in Laravel

Open kishanj918 opened this issue 11 years ago • 4 comments

I have added the following code in my Handler.php file to handle missing routes.

    public function render($request, Exception $e)
    {
        if($e instanceof \Symfony\Component\HttpKernel\Exception\NotFoundHttpException)
                   {
                       return Response::make(view('index'));
                   }
           return parent::render($request, $e);
    }

But it's giving me an error .. I have attached a screen shot.. any guesses? screenshot 10

kishanj918 avatar Apr 08 '15 09:04 kishanj918

Or you can just add a resources/views/errors/404.blade.php file...?

phanan avatar Apr 08 '15 10:04 phanan

Ask on the forums please.

GrahamCampbell avatar Apr 08 '15 10:04 GrahamCampbell

I want to redirect all the missing routes to index view so that further angular'll handle the routing.

kishanj918 avatar Apr 08 '15 10:04 kishanj918

@GrahamCampbell okay.

kishanj918 avatar Apr 08 '15 10:04 kishanj918