瀏覽代碼

ESG Backend & Apis

父節點
當前提交
843e4bd5eb
共有 3 個檔案被更改,包括 6 行新增6 行删除
  1. 1
    1
      app/Http/Controllers/Api/EsgController.php
  2. 2
    2
      app/Models/Esg.php
  3. 3
    3
      app/Models/EsgMain.php

+ 1
- 1
app/Http/Controllers/Api/EsgController.php 查看文件

129
                             "type" => "image",
129
                             "type" => "image",
130
                             "images" => array_map(function($image) use ($locate) {
130
                             "images" => array_map(function($image) use ($locate) {
131
                                 return [
131
                                 return [
132
-                                    "image_url" => Storage::url($image["image_url"]),
132
+                                    "image_url" => Storage::disk("public")->url($image["image_url"]),
133
                                     "alt" => $image["image_alt"][$locate]
133
                                     "alt" => $image["image_alt"][$locate]
134
                                 ];
134
                                 ];
135
                             }, $content["multiple_images"])
135
                             }, $content["multiple_images"])

+ 2
- 2
app/Models/Esg.php 查看文件

27
     protected function bannerPcUrl(): Attribute
27
     protected function bannerPcUrl(): Attribute
28
     {
28
     {
29
         return Attribute::make(
29
         return Attribute::make(
30
-            get: fn ($value) => is_null($this->banner_pc) ? null :Storage::url($this->banner_pc),
30
+            get: fn ($value) => is_null($this->banner_pc) ? null :Storage::disk('public')->url($this->banner_pc),
31
         );
31
         );
32
     }
32
     }
33
 
33
 
34
     protected function bannerMobileUrl(): Attribute
34
     protected function bannerMobileUrl(): Attribute
35
     {
35
     {
36
         return Attribute::make(
36
         return Attribute::make(
37
-            get: fn ($value) => is_null($this->banner_mobile) ? null :Storage::url($this->banner_mobile),
37
+            get: fn ($value) => is_null($this->banner_mobile) ? null :Storage::disk('public')->url($this->banner_mobile),
38
         );
38
         );
39
     }
39
     }
40
 
40
 

+ 3
- 3
app/Models/EsgMain.php 查看文件

16
     protected function imgPcUrl(): Attribute
16
     protected function imgPcUrl(): Attribute
17
     {
17
     {
18
         return Attribute::make(
18
         return Attribute::make(
19
-            get: fn ($value) => is_null($this->img_pc) ? null :Storage::url($this->img_pc),
19
+            get: fn ($value) => is_null($this->img_pc) ? null :Storage::disk('public')->url($this->img_pc),
20
         );
20
         );
21
     }
21
     }
22
     protected function imgMobileUrl(): Attribute
22
     protected function imgMobileUrl(): Attribute
23
     {
23
     {
24
         return Attribute::make(
24
         return Attribute::make(
25
-            get: fn ($value) => is_null($this->img_mobile) ? null :Storage::url($this->img_mobile),
25
+            get: fn ($value) => is_null($this->img_mobile) ? null :Storage::disk('public')->url($this->img_mobile),
26
         );
26
         );
27
     }
27
     }
28
     protected function ogImgUrl(): Attribute
28
     protected function ogImgUrl(): Attribute
29
     {
29
     {
30
         return Attribute::make(
30
         return Attribute::make(
31
-            get: fn ($value) => is_null($this->og_img) ? null :Storage::url($this->og_img),
31
+            get: fn ($value) => is_null($this->og_img) ? null :Storage::disk('public')->url($this->og_img),
32
         );
32
         );
33
     }
33
     }
34
     public static function getMain(): self
34
     public static function getMain(): self