public function boot(Application $app)
    {
        $app->on(KernelEvents::EXCEPTION, function (GetResponseForExceptionEvent $event) {
            $e = $event->getException();
            if ($e instanceof MethodNotAllowedHttpException && $e->getHeaders()["Allow"] === "OPTIONS") {
                $event->setException(new NotFoundHttpException("No route found for \"{$event->getRequest()->getMethod()} {$event->getRequest()->getPathInfo()}\""));
            }
        });
    }
public function boot(Application $app)
    {
        $app->on(KernelEvents::EXCEPTION, function (GetResponseForExceptionEvent $event) {
            $e = $event->getException();
            if ($e instanceof MethodNotAllowedHttpException && $e->getHeaders()["Allow"] === "OPTIONS") {
                $event->setException(new NotFoundHttpException("No route found for \"{$event->getRequest()->getMethod()} {$event->getRequest()->getPathInfo()}\""));
            }
        });
    }
public function boot ( Application $ app ) { $ app -> on ( KernelEvents :: EXCEPTION , function ( GetResponseForExceptionEvent $ event ) { $ e = $ event -> getException ( ) ; if ( $ e instanceof MethodNotAllowedHttpException && $ e -> getHeaders ( ) [ "Allow" ] === "OPTIONS" ) { $ event -> setException ( new NotFoundHttpException ( "No route found for \"{$event->getRequest()->getMethod()} {$event->getRequest()->getPathInfo()}\"" ) ) ; } } ) ; }
Add OPTIONS method support for all routes

@param Application $app
Add OPTIONS method support for all routes