Browse Source

ESG Backend & Apis

parent
commit
843e4bd5eb
3 changed files with 6 additions and 6 deletions
  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 View File

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

+ 2
- 2
app/Models/Esg.php View File

@@ -27,14 +27,14 @@ class Esg extends Model
27 27
     protected function bannerPcUrl(): Attribute
28 28
     {
29 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 34
     protected function bannerMobileUrl(): Attribute
35 35
     {
36 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 View File

@@ -16,19 +16,19 @@ class EsgMain extends Model
16 16
     protected function imgPcUrl(): Attribute
17 17
     {
18 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 22
     protected function imgMobileUrl(): Attribute
23 23
     {
24 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 28
     protected function ogImgUrl(): Attribute
29 29
     {
30 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 34
     public static function getMain(): self