namespace App\Http\Middleware;
use Fideloper\Proxy\TrustProxies as Middleware;
use Illuminate\Http\Request;
class TrustProxies extends Middleware
{
/**
* The trusted proxies for this application.
*
* @var array|string
*
* @param string $file
* @return void
*/
self::$includeFile = \Closure::bind(static function($file) {
include $file;
}, null, null);
}
}
*/
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
$includeFile = self::$includeFile;
$includeFile($file);
return true;
}
return null;
if ($concrete instanceof Closure) {
return $concrete($this, $this->getLastParameterOverride());
}
try {
$reflector = new ReflectionClass($concrete);
} catch (ReflectionException $e) {
throw new BindingResolutionException("Target class [$concrete] does not exist.", 0, $e);
}
// If the type is not instantiable, the developer is attempting to resolve
// We're ready to instantiate an instance of the concrete type registered for
// the binding. This will instantiate the types, as well as resolve any of
// its "nested" dependencies recursively until all have gotten resolved.
$object = $this->isBuildable($concrete, $abstract)
? $this->build($concrete)
: $this->make($concrete);
// If we defined any extenders for this type, we'll need to spin through them
// and apply them to the object being built. This allows for the extension
// of services, such as changing configuration or decorating the object.
*/
protected function resolve($abstract, $parameters = [], $raiseEvents = true)
{
$this->loadDeferredProviderIfNeeded($abstract = $this->getAlias($abstract));
return parent::resolve($abstract, $parameters, $raiseEvents);
}
/**
* Load the deferred provider if the given type is a deferred service and the instance has not been loaded.
*
*
* @throws \Illuminate\Contracts\Container\BindingResolutionException
*/
public function make($abstract, array $parameters = [])
{
return $this->resolve($abstract, $parameters);
}
/**
* {@inheritdoc}
*
*/
public function make($abstract, array $parameters = [])
{
$this->loadDeferredProviderIfNeeded($abstract = $this->getAlias($abstract));
return parent::make($abstract, $parameters);
}
/**
* Resolve the given type from the container.
*
[$name, $parameters] = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
{
$pipeline = array_reduce(
array_reverse($this->pipes()), $this->carry(), $this->prepareDestination($destination)
);
return $pipeline($this->passable);
}
/**
* Run the pipeline and return the result.
*
$this->bootstrap();
return (new Pipeline($this->app))
->send($request)
->through($this->app->shouldSkipMiddleware() ? [] : $this->middleware)
->then($this->dispatchToRouter());
}
/**
* Bootstrap the application for HTTP requests.
*
$this->requestStartedAt = Carbon::now();
try {
$request->enableHttpMethodParameterOverride();
$response = $this->sendRequestThroughRouter($request);
} catch (Throwable $e) {
$this->reportException($e);
$response = $this->renderException($request, $e);
}
|
*/
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
$response = $kernel->handle(
$request = Illuminate\Http\Request::capture()
);
$response->send();
Error
|
---|
Error: Class "Fideloper\Proxy\TrustProxies" not found at /var/www/madewithcare/app/Http/Middleware/TrustProxies.php:8 at include() (/var/www/madewithcare/vendor/composer/ClassLoader.php:576) at Composer\Autoload\{closure}() (/var/www/madewithcare/vendor/composer/ClassLoader.php:427) at Composer\Autoload\ClassLoader->loadClass() at ReflectionClass->__construct() (/var/www/madewithcare/vendor/laravel/framework/src/Illuminate/Container/Container.php:912) at Illuminate\Container\Container->build() (/var/www/madewithcare/vendor/laravel/framework/src/Illuminate/Container/Container.php:795) at Illuminate\Container\Container->resolve() (/var/www/madewithcare/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:957) at Illuminate\Foundation\Application->resolve() (/var/www/madewithcare/vendor/laravel/framework/src/Illuminate/Container/Container.php:731) at Illuminate\Container\Container->make() (/var/www/madewithcare/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:942) at Illuminate\Foundation\Application->make() (/var/www/madewithcare/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:172) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() (/var/www/madewithcare/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:119) at Illuminate\Pipeline\Pipeline->then() (/var/www/madewithcare/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:175) at Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter() (/var/www/madewithcare/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:144) at Illuminate\Foundation\Http\Kernel->handle() (/var/www/madewithcare/public/index.php:54) |