Laravel - File Storage - On Demand Disks

Sometimes you may wish to create a disk at runtime using a given configuration without that configuration actually being present in your application's filesystems configuration file. To accomplish this, you may pass a configuration array to the Storage facade's build method:

    
    use Illuminate\Support\Facades\Storage;
    
    $disk = Storage::build([
        'driver' => 'local',
        'root' => '/path/to/root',
    ]);
    
    $disk->put('image.jpg', $content);