Search code examples
laravelfilesystemslumenfacadeflysystem

Lumen Storage - FileNotFoundException


I added flysystem to Lumen so I can use the Storage Facade.

I added the correct config file and then I'm trying:

$template = Storage::get(storage_path('a.html'));

Config:

'disks' => [
    'local' => [
        'driver' => 'local',
        'root' => storage_path(),
        'url' => env('APP_URL').'/storage',
    ],
    'public' => [
        'driver' => 'local',
        'root' => storage_path(),
        'url' => env('APP_URL').'/storage',
        'visibility' => 'public',
    ],

I'm getting:

FileNotFoundException /var/www/storage/a.html

The file exists in that location.

Any clues?


Solution

  • Try Storage::get(“a.html”) instead