record daily usage

This commit is contained in:
Čarodej
2021-12-10 16:37:00 +01:00
parent 26f367031e
commit 9275487cfa
8 changed files with 186 additions and 27 deletions
@@ -76,7 +76,7 @@ class UploadFileAction
$disk_local->move("chunks/$chunkName", "files/$user_id/$fileName");
// Move files to external storage
if (! is_storage_driver(['local'])) {
if (! is_storage_driver('local')) {
($this->moveFileToExternalStorage)($fileName, $user_id);
}
+2 -2
View File
@@ -93,7 +93,7 @@ class File extends Model
$links = [];
// Generate thumbnail link for external storage service
if ($this->type === 'image' && ! is_storage_driver(['local'])) {
if ($this->type === 'image' && ! is_storage_driver('local')) {
foreach (config('vuefilemanager.image_sizes') as $item) {
$filePath = "files/{$this->user_id}/{$item['name']}-{$this->basename}";
@@ -127,7 +127,7 @@ class File extends Model
public function getFileUrlAttribute(): string
{
// Get file from external storage
if (! is_storage_driver(['local'])) {
if (! is_storage_driver('local')) {
$file_pretty_name = is_storage_driver('backblaze')
? Str::snake(mb_strtolower($this->attributes['name']))
: get_pretty_name($this->attributes['basename'], $this->attributes['name'], $this->attributes['mimetype']);