diff --git a/app/Http/Controllers/Api/ApiV1Controller.php b/app/Http/Controllers/Api/ApiV1Controller.php index 37412c489..e6f60d066 100644 --- a/app/Http/Controllers/Api/ApiV1Controller.php +++ b/app/Http/Controllers/Api/ApiV1Controller.php @@ -3675,7 +3675,8 @@ class ApiV1Controller extends Controller ->filter(function($post) { return $post && isset($post['id']); }) - ->take(3); + ->take(3) + ->values(); $profile['recent_posts'] = $ids; return $profile; }) diff --git a/app/Services/MediaStorageService.php b/app/Services/MediaStorageService.php index 44bf9a6ed..a2a2c5058 100644 --- a/app/Services/MediaStorageService.php +++ b/app/Services/MediaStorageService.php @@ -77,7 +77,9 @@ class MediaStorageService { protected function cloudStore($media) { if($media->remote_media == true) { - (new self())->remoteToCloud($media); + if(config('media.storage.remote.cloud')) { + (new self())->remoteToCloud($media); + } } else { (new self())->localToCloud($media); } diff --git a/config/media.php b/config/media.php index c73b26798..b7d6e95cc 100644 --- a/config/media.php +++ b/config/media.php @@ -6,4 +6,19 @@ return [ 'exif' => [ '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) + ], + ] ];