*
* @throws \Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException
*/
protected function methodNotAllowed(array $others, $method)
{
throw new MethodNotAllowedHttpException(
$others,
sprintf(
'The %s method is not supported for this route. Supported methods: %s.',
$method,
implode(', ', $others)
// another HTTP verb. If it is we will need to throw a MethodNotAllowed and
// inform the user agent of which HTTP verb it should use for this route.
$others = $this->checkForAlternateVerbs($request);
if (count($others) > 0) {
return $this->getRouteForMethods($request, $others);
}
throw new NotFoundHttpException;
}
// First, we will see if we can find a matching route for this current request
// method. If we can, great, we can just return it so that it can be called
// by the consumer. Otherwise we will check for routes with another verb.
$route = $this->matchAgainstRoutes($routes, $request);
return $this->handleMatchedRoute($request, $route);
}
/**
* Get routes from the collection by method.
*
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
*/
public function handle($request, Closure $next)
{
// Check if we're dealing with CORS and if we should handle it
if (! $this->shouldRun($request)) {
return $next($request);
}
// For Preflight, return the Preflight response
if ($this->cors->isPreflightRequest($request)) {
return $this->cors->handlePreflightRequest($request);
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
public function handle(Request $request, Closure $next)
{
$request::setTrustedProxies([], $this->getTrustedHeaderNames()); // Reset trusted proxies between requests
$this->setTrustedProxyIpAddresses($request);
return $next($request);
}
/**
* Sets the trusted proxies on the request to the value of trustedproxy.proxies
*
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
MethodNotAllowedHttpException |
---|
Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException: The GET method is not supported for this route. Supported methods: POST. at /www/wwwroot/cubalan.info/vendor/laravel/framework/src/Illuminate/Routing/AbstractRouteCollection.php:117 at Illuminate\Routing\AbstractRouteCollection->methodNotAllowed() (/www/wwwroot/cubalan.info/vendor/laravel/framework/src/Illuminate/Routing/AbstractRouteCollection.php:103) at Illuminate\Routing\AbstractRouteCollection->getRouteForMethods() (/www/wwwroot/cubalan.info/vendor/laravel/framework/src/Illuminate/Routing/AbstractRouteCollection.php:40) at Illuminate\Routing\AbstractRouteCollection->handleMatchedRoute() (/www/wwwroot/cubalan.info/vendor/laravel/framework/src/Illuminate/Routing/RouteCollection.php:162) at Illuminate\Routing\RouteCollection->match() (/www/wwwroot/cubalan.info/vendor/laravel/framework/src/Illuminate/Routing/Router.php:639) at Illuminate\Routing\Router->findRoute() (/www/wwwroot/cubalan.info/vendor/laravel/framework/src/Illuminate/Routing/Router.php:628) at Illuminate\Routing\Router->dispatchToRoute() (/www/wwwroot/cubalan.info/vendor/laravel/framework/src/Illuminate/Routing/Router.php:617) at Illuminate\Routing\Router->dispatch() (/www/wwwroot/cubalan.info/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:165) at Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}() (/www/wwwroot/cubalan.info/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:128) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() (/www/wwwroot/cubalan.info/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21) at Illuminate\Foundation\Http\Middleware\TransformsRequest->handle() (/www/wwwroot/cubalan.info/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() (/www/wwwroot/cubalan.info/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21) at Illuminate\Foundation\Http\Middleware\TransformsRequest->handle() (/www/wwwroot/cubalan.info/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() (/www/wwwroot/cubalan.info/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php:27) at Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle() (/www/wwwroot/cubalan.info/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() (/www/wwwroot/cubalan.info/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php:63) at Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle() (/www/wwwroot/cubalan.info/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() (/www/wwwroot/cubalan.info/vendor/fruitcake/laravel-cors/src/HandleCors.php:37) at Fruitcake\Cors\HandleCors->handle() (/www/wwwroot/cubalan.info/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() (/www/wwwroot/cubalan.info/vendor/fideloper/proxy/src/TrustProxies.php:57) at Fideloper\Proxy\TrustProxies->handle() (/www/wwwroot/cubalan.info/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() (/www/wwwroot/cubalan.info/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:103) at Illuminate\Pipeline\Pipeline->then() (/www/wwwroot/cubalan.info/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:140) at Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter() (/www/wwwroot/cubalan.info/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:109) at Illuminate\Foundation\Http\Kernel->handle() (/www/wwwroot/cubalan.info/public/index.php:59) |