Symfony Exception

MethodNotAllowedHttpException

HTTP 405 Method Not Allowed

Exception

Symfony\Component\HttpKernel\Exception\ MethodNotAllowedHttpException

Show exception properties
Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException {#411
  -statusCode: 405
  -headers: array:1 [
    "Allow" => "OPTIONS"
  ]
}
  1.     {
  2.         switch ($routeInfo[0]) {
  3.             case Dispatcher::NOT_FOUND:
  4.                 throw new NotFoundHttpException;
  5.             case Dispatcher::METHOD_NOT_ALLOWED:
  6.                 throw new MethodNotAllowedHttpException($routeInfo[1]);
  7.             case Dispatcher::FOUND:
  8.                 return $this->handleFoundRoute($routeInfo);
  9.         }
  10.     }
  1.                 if (isset($this->router->getRoutes()[$method.$pathInfo])) {
  2.                     return $this->handleFoundRoute([true$this->router->getRoutes()[$method.$pathInfo]['action'], []]);
  3.                 }
  4.                 return $this->handleDispatcherResponse(
  5.                     $this->createDispatcher()->dispatch($method$pathInfo)
  6.                 );
  7.             });
  8.         } catch (Throwable $e) {
  9.             return $this->prepareResponse($this->sendExceptionToHandler($e));
in /var/www/html/vendor/laravel/lumen-framework/src/Routing/Pipeline.php -> Laravel\Lumen\Concerns\{closure} (line 48)
  1.      */
  2.     protected function prepareDestination(BaseClosure $destination)
  3.     {
  4.         return function ($passable) use ($destination) {
  5.             try {
  6.                 return $destination($passable);
  7.             } catch (Throwable $e) {
  8.                 return $this->handleException($passable$e);
  9.             }
  10.         };
  11.     }
  1. class FlushEventsMiddleware
  2. {
  3.     public function handle(Request $requestClosure $next)
  4.     {
  5.         return $next($request);
  6.     }
  7.     public function terminate(Request $request$response): void
  8.     {
  9.         Integration::flushEvents();
  1.                         // since the object we're given was already a fully instantiated object.
  2.                         $parameters = [$passable$stack];
  3.                     }
  4.                     $carry method_exists($pipe$this->method)
  5.                                     ? $pipe->{$this->method}(...$parameters)
  6.                                     : $pipe(...$parameters);
  7.                     return $this->handleCarry($carry);
  8.                 } catch (Throwable $e) {
  9.                     return $this->handleException($passable$e);
  1.         return function ($stack$pipe) {
  2.             return function ($passable) use ($stack$pipe) {
  3.                 try {
  4.                     $slice parent::carry();
  5.                     return ($slice($stack$pipe))($passable);
  6.                 } catch (Throwable $e) {
  7.                     return $this->handleException($passable$e);
  8.                 }
  9.             };
  10.         };
  1.                     ]);
  2.                 });
  3.             }
  4.         }
  5.         return $next($request);
  6.     }
  7. }
  1.                         // since the object we're given was already a fully instantiated object.
  2.                         $parameters = [$passable$stack];
  3.                     }
  4.                     $carry method_exists($pipe$this->method)
  5.                                     ? $pipe->{$this->method}(...$parameters)
  6.                                     : $pipe(...$parameters);
  7.                     return $this->handleCarry($carry);
  8.                 } catch (Throwable $e) {
  9.                     return $this->handleException($passable$e);
  1.         return function ($stack$pipe) {
  2.             return function ($passable) use ($stack$pipe) {
  3.                 try {
  4.                     $slice parent::carry();
  5.                     return ($slice($stack$pipe))($passable);
  6.                 } catch (Throwable $e) {
  7.                     return $this->handleException($passable$e);
  8.                 }
  9.             };
  10.         };
  1.             if ($psrRequest !== null) {
  2.                 $container->instance(LaravelRequestFetcher::CONTAINER_PSR7_INSTANCE_KEY$psrRequest);
  3.             }
  4.         }
  5.         return $next($request);
  6.     }
  7.     private function resolvePsrRequest(Container $container): ?ServerRequestInterface
  8.     {
  9.         try {
  1.                         // since the object we're given was already a fully instantiated object.
  2.                         $parameters = [$passable$stack];
  3.                     }
  4.                     $carry method_exists($pipe$this->method)
  5.                                     ? $pipe->{$this->method}(...$parameters)
  6.                                     : $pipe(...$parameters);
  7.                     return $this->handleCarry($carry);
  8.                 } catch (Throwable $e) {
  9.                     return $this->handleException($passable$e);
  1.         return function ($stack$pipe) {
  2.             return function ($passable) use ($stack$pipe) {
  3.                 try {
  4.                     $slice parent::carry();
  5.                     return ($slice($stack$pipe))($passable);
  6.                 } catch (Throwable $e) {
  7.                     return $this->handleException($passable$e);
  8.                 }
  9.             };
  10.         };
  1.     public function handle(Request $requestClosure $next): Response
  2.     {
  3.         $this->logger->info('Request'$this->buildRequest($request));
  4.         /** @var Response $response */
  5.         $response $next($request);
  6.         $response->headers->set(TokenStorage::TOKEN_HEADER$this->tokenStorage->getToken());
  7.         return $response;
  8.     }
  1.                         // since the object we're given was already a fully instantiated object.
  2.                         $parameters = [$passable$stack];
  3.                     }
  4.                     $carry method_exists($pipe$this->method)
  5.                                     ? $pipe->{$this->method}(...$parameters)
  6.                                     : $pipe(...$parameters);
  7.                     return $this->handleCarry($carry);
  8.                 } catch (Throwable $e) {
  9.                     return $this->handleException($passable$e);
  1.         return function ($stack$pipe) {
  2.             return function ($passable) use ($stack$pipe) {
  3.                 try {
  4.                     $slice parent::carry();
  5.                     return ($slice($stack$pipe))($passable);
  6.                 } catch (Throwable $e) {
  7.                     return $this->handleException($passable$e);
  8.                 }
  9.             };
  10.         };
Pipeline->Laravel\Lumen\Routing\{closure}(object(Request)) in /var/www/html/app/Http/Middleware/HttpLoggerMiddleware.php (line 26)
  1.             $this->httpLoggerService->log($request);
  2.         } catch (Throwable $e) {
  3.             report($e);
  4.         }
  5.         return $next($request);
  6.     }
  7.     public function terminate(Request $requestResponse $response): void
  8.     {
  9.         try {
  1.                         // since the object we're given was already a fully instantiated object.
  2.                         $parameters = [$passable$stack];
  3.                     }
  4.                     $carry method_exists($pipe$this->method)
  5.                                     ? $pipe->{$this->method}(...$parameters)
  6.                                     : $pipe(...$parameters);
  7.                     return $this->handleCarry($carry);
  8.                 } catch (Throwable $e) {
  9.                     return $this->handleException($passable$e);
  1.         return function ($stack$pipe) {
  2.             return function ($passable) use ($stack$pipe) {
  3.                 try {
  4.                     $slice parent::carry();
  5.                     return ($slice($stack$pipe))($passable);
  6.                 } catch (Throwable $e) {
  7.                     return $this->handleException($passable$e);
  8.                 }
  9.             };
  10.         };
Pipeline->Laravel\Lumen\Routing\{closure}(object(Request)) in /var/www/html/app/Http/Middleware/NewRelicTransactionName.php (line 21)
  1.      * @param Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
  2.      * @return Response|RedirectResponse
  3.      */
  4.     public function handle(Request $requestClosure $next)
  5.     {
  6.         $response $next($request);
  7.         if (extension_loaded('newrelic')) { // Ensure PHP agent is available
  8.             newrelic_name_transaction($this->getTransactionName($request));
  9.         }
  1.                         // since the object we're given was already a fully instantiated object.
  2.                         $parameters = [$passable$stack];
  3.                     }
  4.                     $carry method_exists($pipe$this->method)
  5.                                     ? $pipe->{$this->method}(...$parameters)
  6.                                     : $pipe(...$parameters);
  7.                     return $this->handleCarry($carry);
  8.                 } catch (Throwable $e) {
  9.                     return $this->handleException($passable$e);
  1.         return function ($stack$pipe) {
  2.             return function ($passable) use ($stack$pipe) {
  3.                 try {
  4.                     $slice parent::carry();
  5.                     return ($slice($stack$pipe))($passable);
  6.                 } catch (Throwable $e) {
  7.                     return $this->handleException($passable$e);
  8.                 }
  9.             };
  10.         };
  1.     {
  2.         $pipeline array_reduce(
  3.             array_reverse($this->pipes()), $this->carry(), $this->prepareDestination($destination)
  4.         );
  5.         return $pipeline($this->passable);
  6.     }
  7.     /**
  8.      * Run the pipeline and return the result.
  9.      *
  1.     {
  2.         if (count($middleware) > && ! $this->shouldSkipMiddleware()) {
  3.             return (new Pipeline($this))
  4.                 ->send($this->make('request'))
  5.                 ->through($middleware)
  6.                 ->then($then);
  7.         }
  8.         return $then($this->make('request'));
  9.     }
  1.         [$method$pathInfo] = $this->parseIncomingRequest($request);
  2.         try {
  3.             $this->boot();
  4.             return $this->sendThroughPipeline($this->middleware, function ($request) use ($method$pathInfo) {
  5.                 $this->instance(Request::class, $request);
  6.                 if (isset($this->router->getRoutes()[$method.$pathInfo])) {
  7.                     return $this->handleFoundRoute([true$this->router->getRoutes()[$method.$pathInfo]['action'], []]);
  8.                 }
  1.      * @param  \Symfony\Component\HttpFoundation\Request|null  $request
  2.      * @return void
  3.      */
  4.     public function run($request null)
  5.     {
  6.         $response $this->dispatch($request);
  7.         if ($response instanceof SymfonyResponse) {
  8.             $response->send();
  9.         } else {
  10.             echo (string) $response;
Application->run() in /var/www/html/public/index.php (line 28)
  1. | the client's browser allowing them to enjoy the creative
  2. | and wonderful application we have prepared for them.
  3. |
  4. */
  5. $app->run();

Stack Trace

MethodNotAllowedHttpException
Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException:

  at /var/www/html/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:237
  at Laravel\Lumen\Application->handleDispatcherResponse(array(2, array('OPTIONS')))
     (/var/www/html/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:174)
  at Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}(object(Request))
     (/var/www/html/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:48)
  at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}(object(Request))
     (/var/www/html/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Http/FlushEventsMiddleware.php:13)
  at Sentry\Laravel\Http\FlushEventsMiddleware->handle(object(Request), object(Closure))
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request))
     (/var/www/html/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:30)
  at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}(object(Request))
     (/var/www/html/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Http/SetRequestIpMiddleware.php:45)
  at Sentry\Laravel\Http\SetRequestIpMiddleware->handle(object(Request), object(Closure))
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request))
     (/var/www/html/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:30)
  at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}(object(Request))
     (/var/www/html/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Http/SetRequestMiddleware.php:31)
  at Sentry\Laravel\Http\SetRequestMiddleware->handle(object(Request), object(Closure))
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request))
     (/var/www/html/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:30)
  at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}(object(Request))
     (/var/www/html/vendor/taker-io/lib-logger/src/Middlewares/LaravelHttpLogMiddleware.php:28)
  at TakerIo\Logger\Middlewares\LaravelHttpLogMiddleware->handle(object(Request), object(Closure))
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request))
     (/var/www/html/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:30)
  at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}(object(Request))
     (/var/www/html/app/Http/Middleware/HttpLoggerMiddleware.php:26)
  at App\Http\Middleware\HttpLoggerMiddleware->handle(object(Request), object(Closure))
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request))
     (/var/www/html/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:30)
  at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}(object(Request))
     (/var/www/html/app/Http/Middleware/NewRelicTransactionName.php:21)
  at App\Http\Middleware\NewRelicTransactionName->handle(object(Request), object(Closure))
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request))
     (/var/www/html/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:30)
  at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}(object(Request))
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:116)
  at Illuminate\Pipeline\Pipeline->then(object(Closure))
     (/var/www/html/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:428)
  at Laravel\Lumen\Application->sendThroughPipeline(array('App\\Http\\Middleware\\NewRelicTransactionName', 'App\\Http\\Middleware\\HttpLoggerMiddleware', 'TakerIo\\Logger\\Middlewares\\LaravelHttpLogMiddleware', 'Sentry\\Laravel\\Http\\SetRequestMiddleware', 'Sentry\\Laravel\\Http\\SetRequestIpMiddleware', 'Sentry\\Laravel\\Http\\FlushEventsMiddleware'), object(Closure))
     (/var/www/html/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:167)
  at Laravel\Lumen\Application->dispatch(null)
     (/var/www/html/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:112)
  at Laravel\Lumen\Application->run()
     (/var/www/html/public/index.php:28)