Configure Spatie Media Library plugin to upload to Digital Ocean

Ok, I installed the plugin, all good. Then, I created a DO Spaces bucket, add the CORS config, then in Laravel installed the required packages, added the disk with the name 'digitalocean', and it worked good. When I do a simple Storage::put('file.txt', 'Contents of the file'); in Tinker to test, it actually creates a file in DO Spaces. All good here. However, when I use the field, and try to add images, those images are saved correctly, except that they go to the public disk. I already change the FILESYSTEM_DISK variable in .env to 'digitalocean' and already change the config in filesystems.php like this 'default' => env('FILESYSTEM_DISK', 'digitalocean'), I also made sure to publish the media-library.php config, and change the disk_name to this 'disk_name' => 'digitalocean', Actually, the livewire part of the field performs a temporary file upload, and if I specify the 'digitalocean' disk in the livewire.php config file, it actually works. So, when I save the file, why is Media Library still sending the files to the public disk? Is there any other config that I need to change?
3 Replies
wyChoong
wyChoong2y ago
FORMS_FILESYSTEM_DRIVER FILAMENT_FILESYSTEM_DRIVER if you using admin panel
barrerakj
barrerakjOP2y ago
Awesome, thank you so much, that makes so much sense! I guess that's a variable for my .env file, right?
wyChoong
wyChoong2y ago
Yes
Want results from more Discord servers?
Add your server