mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-27 18:40:39 +00:00
record daily usage
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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']);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
namespace Domain\Traffic\Models;
|
||||
|
||||
use Database\Factories\TrafficFactory;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
@@ -22,6 +23,11 @@ class Traffic extends Model
|
||||
|
||||
protected $keyType = 'string';
|
||||
|
||||
protected static function newFactory(): TrafficFactory
|
||||
{
|
||||
return TrafficFactory::new();
|
||||
}
|
||||
|
||||
public function scopeCurrentDay($query): Builder
|
||||
{
|
||||
return $query->whereDate('created_at', today());
|
||||
|
||||
Reference in New Issue
Block a user