From 4701b0e8f075209cec43f06d0b4b684fabfc4326 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Wed, 30 Mar 2022 23:50:32 -0600 Subject: [PATCH] Update media model, use original photo url for non-existent thumbnails --- app/Media.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Media.php b/app/Media.php index e6b3ee07..1494ab88 100644 --- a/app/Media.php +++ b/app/Media.php @@ -56,7 +56,9 @@ class Media extends Model } if($this->media_path && $this->mime && in_array($this->mime, ['image/jpeg', 'image/png'])) { - return url(Storage::url($this->media_path)); + return $this->remote_media || Str::startsWith($this->media_path, 'http') ? + $this->media_path : + url(Storage::url($this->media_path)); } return url(Storage::url('public/no-preview.png'));