generic thumbnail for password protected files
This commit is contained in:
@@ -147,12 +147,14 @@ class Media extends Model
|
||||
*/
|
||||
public function getThumbnailAttribute(): string
|
||||
{
|
||||
if($this->password !== null) {
|
||||
if ($this->hasVariant('thumbnail')) {
|
||||
$url = $this->url('thumbnail', true);
|
||||
if ($url !== '') {
|
||||
return $url;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$thumbnail = '/thumbnails/' . pathinfo($this->name, PATHINFO_EXTENSION) . '.webp';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user