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

View file

@ -55,6 +55,10 @@ class Media extends Model
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'));
}