I am trying to save in the 'cloud' some files.
Using: Storage::disk('local')->put('filename', $file)
works.
Using 's3' disk also works: Storage::disk('s3')->put('filename', $file)
BUT
when trying 'cloud': Storage::disk('cloud')->put('filename', $file)
it returns the following error:
BadMethodCallException in PluggableTrait.php line 85: Call to undefined method League\Flysystem\Filesystem::createDriver
Any idea why and how to fix it?
Thanks!
Two years late to the party, but to help those that might find this post as I did. I believe what you want is...
Correct, only if you have a disk
named 'cloud'.
$url = Storage::disk('cloud')->put('filename', $file);
Else; this uses the disk matching the name entered in config('filesystem.cloud')
.
$url = Storage::cloud()->put('filename', $file);
If you are using this into a controller, what you should do is:
use Illuminate\Contracts\Filesystem\Cloud;
......
public function test(Cloud $cloud) {
$cloud->...
}
Hope this helps you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With