Skip to content

Commit

Permalink
Update media model, use original photo url for non-existent thumbnails
Browse files Browse the repository at this point in the history
  • Loading branch information
dansup committed Mar 31, 2022
1 parent 2533bd5 commit 9b04b9d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/Media.php
Expand Up @@ -55,6 +55,10 @@ public function thumbnailUrl()
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'));
}

Expand Down

0 comments on commit 9b04b9d

Please sign in to comment.