Added store remote media on S3 config setting, disabled by default

This commit is contained in:
Daniel Supernault 2023-05-07 01:35:51 -06:00
parent 37bd2ee51b
commit 51768083fe
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
2 changed files with 18 additions and 1 deletions

View file

@ -77,7 +77,9 @@ class MediaStorageService {
protected function cloudStore($media) protected function cloudStore($media)
{ {
if($media->remote_media == true) { if($media->remote_media == true) {
if(config('media.storage.remote.cloud')) {
(new self())->remoteToCloud($media); (new self())->remoteToCloud($media);
}
} else { } else {
(new self())->localToCloud($media); (new self())->localToCloud($media);
} }

View file

@ -6,4 +6,19 @@ return [
'exif' => [ 'exif' => [
'database' => env('MEDIA_EXIF_DATABASE', false), 'database' => env('MEDIA_EXIF_DATABASE', false),
], ],
'storage' => [
'remote' => [
/*
|--------------------------------------------------------------------------
| Store remote media on cloud/S3
|--------------------------------------------------------------------------
|
| Set this to cache remote media on cloud/S3 filesystem drivers.
| Disabled by default.
|
*/
'cloud' => env('MEDIA_REMOTE_STORE_CLOUD', false)
],
]
]; ];