Lumen-framework: Driver [] is not supported Storage::disk

Created on 26 Sep 2017  路  5Comments  路  Source: laravel/lumen-framework

  • Lumen Version: 5.5
  • PHP Version: 7.0
  • Database Driver & Version:

Description:

lumen.ERROR: InvalidArgumentException: Driver [] is not supported. in /var/www/html/vendor/illuminate/filesystem/FilesystemManager.php:124

Steps To Reproduce:

boopstrapapp.php

$app->singleton( Illuminate\Contracts\Filesystem\Factory::class, function ($app) { return new Illuminate\Filesystem\FilesystemManager($app); } );

in customController.php

use Illuminate\Support\Facades\Storage; class MessageController extends Controller { Storage::disk('local')->put('file.txt', 'Contents'); }

Most helpful comment

I had this same issue, It was missing $app->configure('filesystems'); in boopstrapapp.php

All 5 comments

Hello @alexisaraya it is missing feature rather than a bug. In your case you forgot just add dependency for filesystem local driver. Running following command should be enough to solve your problem: composer require league/flysystem. In case there will be some more issues you can follow my
short "how to"guide: https://gist.github.com/deividaspetraitis/4cca4fa6a61cc9a75e12f640041e53f5
Hope it helps!

I had this same issue, It was missing $app->configure('filesystems'); in boopstrapapp.php

This is still an ongoing issue and it might be related to this line.

$this->app->singleton('filesystem.disk', function () {
        return $this->app['filesystem']->disk($this->getDefaultDriver());
    });

    $this->app->singleton('filesystem.cloud', function () {
        return $this->app['filesystem']->disk($this->getCloudDriver());
    });`

I noticed that get default driver is never called.

I figured out the offending line. Either extend a new facade Illuminate\Support\Facades; so the facade accessor is filesystem.disk or extend a new service provider from the default filesystem service provider and change how it works so it is not looking for filesytem.cloud or filesystem.disk alone.

Tranks for your comments and help

Was this page helpful?
0 / 5 - 0 ratings

Related issues

patrikengborg picture patrikengborg  路  3Comments

hamihaa picture hamihaa  路  3Comments

gfazioli picture gfazioli  路  5Comments

dunice picture dunice  路  3Comments

rtheunissen picture rtheunissen  路  3Comments