1
0
Fork 0

Update media model, use original photo url for non-existent thumbnails

This commit is contained in:
Daniel Supernault 2022-03-30 23:43:43 -06:00
parent 2533bd51a9
commit 9b04b9d897
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7
1 changed files with 4 additions and 0 deletions

View File

@ -55,6 +55,10 @@ class Media extends Model
return url(Storage::url($this->thumbnail_path)); return url(Storage::url($this->thumbnail_path));
} }
if($this->media_path && $this->mime && in_array($this->mime, ['image/jpeg', 'image/png'])) {
return url(Storage::url($this->media_path));
}
return url(Storage::url('public/no-preview.png')); return url(Storage::url('public/no-preview.png'));
} }