// Once we have the class and method name, we can build the Closure to resolve
// the instance out of the IoC container and call the method on it with the
// given arguments that are passed to the Closure as the composer's data.
return function () use ($class, $method) {
return $this->container->make($class)->{$method}(...func_get_args());
};
}
/**
* Parse a class based composer name.
}
$responses = [];
foreach ($this->getListeners($event) as $listener) {
$response = $listener($event, $payload);
// If a response is returned from the listener and event halting is enabled
// we will just return this response, and not call the rest of the event
// listeners. Otherwise we will add the response on the response list.
if ($halt && ! is_null($response)) {
// We will keep track of the amount of views being rendered so we can flush
// the section after the complete rendering operation is done. This will
// clear out the sections for any separate views that may be rendered.
$this->factory->incrementRender();
$this->factory->callComposer($this);
$contents = $this->getContents();
// Once we've finished rendering the view, we'll decrement the render count
// so that each sections get flushed out next time a view is created and
* @throws \Throwable
*/
public function render(callable $callback = null)
{
try {
$contents = $this->renderContents();
$response = isset($callback) ? $callback($this, $contents) : null;
// Once we have the contents of the view, we will flush the sections if we are
// done rendering all views so that there is nothing left hanging over when
// If this content implements the "Renderable" interface then we will call the
// render method on the object so we will avoid any "__toString" exceptions
// that might be thrown and have their errors obscured by PHP's handling.
elseif ($content instanceof Renderable) {
$content = $content->render();
}
parent::setContent($content);
return $this;
// 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)) {
$response = $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);
Error |
---|
Error: Call to a member function getName() on null at /var/www/vhosts/novacreative.es/backsubbetica.novacreative.es/app/View/Composers/MenuComposer.php:20 at app\View\Composers\MenuComposer->compose() (/var/www/vhosts/novacreative.es/backsubbetica.novacreative.es/vendor/laravel/framework/src/Illuminate/View/Concerns/ManagesEvents.php:124) at Illuminate\View\Factory->Illuminate\View\Concerns\{closure}() (/var/www/vhosts/novacreative.es/backsubbetica.novacreative.es/vendor/laravel/framework/src/Illuminate/View/Concerns/ManagesEvents.php:162) at Illuminate\View\Factory->Illuminate\View\Concerns\{closure}() (/var/www/vhosts/novacreative.es/backsubbetica.novacreative.es/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:389) at Illuminate\Events\Dispatcher->Illuminate\Events\{closure}() (/var/www/vhosts/novacreative.es/backsubbetica.novacreative.es/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:237) at Illuminate\Events\Dispatcher->dispatch() (/var/www/vhosts/novacreative.es/backsubbetica.novacreative.es/vendor/laravel/framework/src/Illuminate/View/Concerns/ManagesEvents.php:177) at Illuminate\View\Factory->callComposer() (/var/www/vhosts/novacreative.es/backsubbetica.novacreative.es/vendor/laravel/framework/src/Illuminate/View/View.php:120) at Illuminate\View\View->renderContents() (/var/www/vhosts/novacreative.es/backsubbetica.novacreative.es/vendor/laravel/framework/src/Illuminate/View/View.php:91) at Illuminate\View\View->render() (/var/www/vhosts/novacreative.es/backsubbetica.novacreative.es/vendor/laravel/framework/src/Illuminate/Http/Response.php:62) at Illuminate\Http\Response->setContent() (/var/www/vhosts/novacreative.es/backsubbetica.novacreative.es/vendor/laravel/framework/src/Illuminate/Http/Response.php:34) at Illuminate\Http\Response->__construct() (/var/www/vhosts/novacreative.es/backsubbetica.novacreative.es/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php:55) at Illuminate\Routing\ResponseFactory->make() (/var/www/vhosts/novacreative.es/backsubbetica.novacreative.es/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php:85) at Illuminate\Routing\ResponseFactory->view() (/var/www/vhosts/novacreative.es/backsubbetica.novacreative.es/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php:556) at Illuminate\Foundation\Exceptions\Handler->renderHttpException() (/var/www/vhosts/novacreative.es/backsubbetica.novacreative.es/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php:461) at Illuminate\Foundation\Exceptions\Handler->prepareResponse() (/var/www/vhosts/novacreative.es/backsubbetica.novacreative.es/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php:339) at Illuminate\Foundation\Exceptions\Handler->render() (/var/www/vhosts/novacreative.es/backsubbetica.novacreative.es/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:51) at Illuminate\Routing\Pipeline->handleException() (/var/www/vhosts/novacreative.es/backsubbetica.novacreative.es/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:130) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() (/var/www/vhosts/novacreative.es/backsubbetica.novacreative.es/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21) at Illuminate\Foundation\Http\Middleware\TransformsRequest->handle() (/var/www/vhosts/novacreative.es/backsubbetica.novacreative.es/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() (/var/www/vhosts/novacreative.es/backsubbetica.novacreative.es/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21) at Illuminate\Foundation\Http\Middleware\TransformsRequest->handle() (/var/www/vhosts/novacreative.es/backsubbetica.novacreative.es/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() (/var/www/vhosts/novacreative.es/backsubbetica.novacreative.es/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php:27) at Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle() (/var/www/vhosts/novacreative.es/backsubbetica.novacreative.es/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() (/var/www/vhosts/novacreative.es/backsubbetica.novacreative.es/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php:86) at Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle() (/var/www/vhosts/novacreative.es/backsubbetica.novacreative.es/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() (/var/www/vhosts/novacreative.es/backsubbetica.novacreative.es/vendor/fruitcake/laravel-cors/src/HandleCors.php:37) at Fruitcake\Cors\HandleCors->handle() (/var/www/vhosts/novacreative.es/backsubbetica.novacreative.es/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() (/var/www/vhosts/novacreative.es/backsubbetica.novacreative.es/vendor/fideloper/proxy/src/TrustProxies.php:57) at Fideloper\Proxy\TrustProxies->handle() (/var/www/vhosts/novacreative.es/backsubbetica.novacreative.es/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() (/var/www/vhosts/novacreative.es/backsubbetica.novacreative.es/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:103) at Illuminate\Pipeline\Pipeline->then() (/var/www/vhosts/novacreative.es/backsubbetica.novacreative.es/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:141) at Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter() (/var/www/vhosts/novacreative.es/backsubbetica.novacreative.es/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:110) at Illuminate\Foundation\Http\Kernel->handle() (/var/www/vhosts/novacreative.es/backsubbetica.novacreative.es/public/index.php:52) |