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 $e)
    {
        if($e instanceof \Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException){
            return api_404();
        }
        if($e instanceof \Symfony\Component\HttpKernel\Exception\NotFoundHttpException){
            return api_404();
        }
        if($e instanceof \App\Exceptions\CustomException){
            return $e->render($request);
        }
        $response = parent::render($request, $e);
        if ($request->is('api/*')) {
            app('Asm89\Stack\CorsService')->addActualRequestHeaders($response, $request);
        }
        return $response;
    }
public function render ( $ request , Exception $ e ) { if ( $ e instanceof \ Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException ) { return api_404 ( ) ; } if ( $ e instanceof \ Symfony \ Component \ HttpKernel \ Exception \ NotFoundHttpException ) { return api_404 ( ) ; } if ( $ e instanceof \ App \ Exceptions \ CustomException ) { return $ e -> render ( $ request ) ; } $ response = parent :: render ( $ request , $ e ) ; if ( $ request -> is ( 'api/*' ) ) { app ( 'Asm89\Stack\CorsService' ) -> addActualRequestHeaders ( $ response , $ request ) ; } return $ response ; }
Render an exception into an HTTP response.
Render an exception into an HTTP response .