mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-05-17 02:35:02 +00:00
- S3 storages compatibility with v2
- user profile fixes
This commit is contained in:
+2
-2
@@ -104,7 +104,7 @@ class File extends Model
|
||||
// Get thumbnail from external storage
|
||||
if ($this->attributes['thumbnail'] && ! is_storage_driver(['local'])) {
|
||||
|
||||
return Storage::temporaryUrl('files/' . $this->attributes['thumbnail'], now()->addHour());
|
||||
return Storage::temporaryUrl("files/$this->user_id/{$this->attributes['thumbnail']}", now()->addHour());
|
||||
}
|
||||
|
||||
// Get thumbnail from local storage
|
||||
@@ -145,7 +145,7 @@ class File extends Model
|
||||
'ResponseContentDisposition' => 'attachment; filename=' . $file_pretty_name,
|
||||
];
|
||||
|
||||
return Storage::temporaryUrl('files/' . $this->attributes['basename'], now()->addDay(), $header);
|
||||
return Storage::temporaryUrl("files/$this->user_id/{$this->attributes['basename']}", now()->addDay(), $header);
|
||||
}
|
||||
|
||||
// Get thumbnail from local storage
|
||||
|
||||
@@ -22,7 +22,7 @@ class UserSettings extends Model
|
||||
public function getAvatarAttribute()
|
||||
{
|
||||
// Get avatar from external storage
|
||||
if ($this->attributes['avatar'] && is_storage_driver(['s3', 'spaces', 'wasabi', 'backblaze'])) {
|
||||
if ($this->attributes['avatar'] && ! is_storage_driver('local')) {
|
||||
return Storage::temporaryUrl($this->attributes['avatar'], now()->addDay());
|
||||
}
|
||||
|
||||
@@ -31,6 +31,6 @@ class UserSettings extends Model
|
||||
return url('/' . $this->attributes['avatar']);
|
||||
}
|
||||
|
||||
return url('/assets/images/' . 'default-avatar.png');
|
||||
return url('/assets/images/default-avatar.png');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user