app/Exceptions/Handler.php
/**
     * Render an exception into an HTTP response.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Exception  $exception
     * @return \Illuminate\Http\Response
     */
Render an exception into an HTTP response.
Render an exception into an HTTP response .
public function render($request, Exception $exception)
    {
        if ($exception instanceof NotFoundHttpException) {
            echo  json_encode(
                        [ "status"=>1,
                            "code"=>200,
                            "message"=>[
                                    'error'=>'Route not available for request URL',
                                    'file_path'=>$exception->getfile(),
                                    'line_number'=>$exception->getline()],    
                      "data" => "" 
                    ]
                );
            exit();
        }
        return parent::render($request, $exception);
    }
public function render ( $ request , Exception $ exception ) { if ( $ exception instanceof NotFoundHttpException ) { echo json_encode ( [ " status " => 1 , " code " => 200 , " message " => [ 'error' => 'Route not available for request URL' , 'file_path' => $ exception -> getfile ( ) , 'line_number' => $ exception -> getline ( ) ] , " data " => " " ] ) ; exit ( ) ; } return parent :: render ( $ request , $ exception ) ; }
Render an exception into an HTTP response.
Render an exception into an HTTP response .