I try to use the stand alone components of laravel. In this case I try to use illuminate/http. It works fine except the file save after upload is throwing an exception.
( ! ) Fatal error: Uncaught Illuminate\Contracts\Container\BindingResolutionException: Target [Illuminate\Contracts\Filesystem\Factory] is not instantiable. in /var/www/vendor/illuminate/container/Container.php on line 978
( ! ) Illuminate\Contracts\Container\BindingResolutionException: Target [Illuminate\Contracts\Filesystem\Factory] is not instantiable. in /var/www/vendor/illuminate/container/Container.php on line 978
This is my bootstrapping:
use Illuminate\Http\Request;
/** @var Request $request */
$request = new Request(
$_GET,
$_POST,
[],
$_COOKIE,
$_FILES,
$_SERVER
);
And this is the part where I try to store a form post file on my local storage:
$request->image->store(APP_PUBLIC.'resources/assets/images/homepage/slider/test.jpg');
I tried to inject the Illuminate\Filesystem\Filesystem()
as Factory into the Reqest object, but it seems not to work.
How to inject the Filesystem factory into the HTTP component?