1
0
Эх сурвалжийг харах

Update Media model, use cloud filesystem url if enabled instead of cdn_url to easily update S3 media urls

Daniel Supernault 2 жил өмнө
parent
commit
e6bc57d7b6

+ 1 - 1
app/Media.php

@@ -38,7 +38,7 @@ class Media extends Model
     public function url()
     {
         if($this->cdn_url) {
-            return $this->cdn_url;
+            return Storage::disk(config('filesystems.cloud'))->url($this->media_path);
         }
 
         if($this->remote_media && $this->remote_url) {

+ 1 - 0
config/filesystems.php

@@ -82,6 +82,7 @@ return [
             ],
             'root' => env('DO_SPACES_ROOT',''),
             'throw' => true,
+            'url' => env('AWS_URL'),
         ],
 
         'backup' => [