config/filesystems.php
check your code
's3' => [ 'driver' => 's3', 'key' => env('AWS_ACCESS_KEY_ID'), 'secret' => env('AWS_SECRET_ACCESS_KEY'), 'region' => env('AWS_DEFAULT_REGION'), 'bucket' => env('AWS_BUCKET'), 'visibility' => 'public', ],
File uploads are working if using local disk but when switching to s3 driver, I get the following error:
Call to undefined method League\Flysystem\Cached\CachedAdapter::getClient()
// GenerateSignedUploadUrl.php
$command = $adapter->getClient()->getCommand('putObject', array_filter([
'Bucket' => $adapter->getBucket(),
'Key' => $path,
'ACL' => $visibility,
'ContentType' => $fileType ?: 'application/octet-stream',
'CacheControl' => null,
'Expires' => null,
]));
My config is the following:
'temporary_file_upload' => [
'disk' => 's3',
'rules' => ['required', 'file', 'max:40000'],
'directory' => 'livewire-tmp',
'middleware' => 'throttle:10,1',
'preview_mimes' => [
'png', 'gif', 'bmp', 'svg', 'wav', 'mp4',
'mov', 'avi', 'wmv', 'mp3', 'm4a',
'jpeg', 'mpga', 'webp', 'wma'
],
],
I have this same s3 disk working for other uploads. It's just crashing for the temporary uploads from Livewire.
The problems appear when you add cache to the s3 entry in the filesystems.php fille. I sent a pull request to the Livewire repo in order to fix this.
Please or to participate in this conversation.