Showing
1 changed file
with
11 additions
and
0 deletions
... | @@ -34,6 +34,17 @@ class Immerse extends Model | ... | @@ -34,6 +34,17 @@ class Immerse extends Model |
34 | return Storage::disk('public')->url($url); | 34 | return Storage::disk('public')->url($url); |
35 | } | 35 | } |
36 | 36 | ||
37 | + public function getThumbnailAttribute($url) | ||
38 | + { | ||
39 | + if (Str::contains($url, '//') || $url == '') return $url; | ||
40 | + | ||
41 | + if (Str::contains($url, '/storage/app/public/')) { | ||
42 | + $str = Str::of($url)->replace('/usr/local/nginx/html/OnePoem/storage/app/public/', ''); | ||
43 | + return Storage::disk('public')->url($str); | ||
44 | + } | ||
45 | + | ||
46 | + return Storage::disk('public')->url($url); | ||
47 | + } | ||
37 | 48 | ||
38 | public function poem() | 49 | public function poem() |
39 | { | 50 | { | ... | ... |
-
Please register or login to post a comment