mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-18 00:02:15 +00:00
refactoring
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Users\Models;
|
||||
|
||||
use ByteUnits\Metric;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Str;
|
||||
use Domain\Files\Models\File;
|
||||
use Domain\Folders\Models\Folder;
|
||||
@@ -141,8 +142,9 @@ class User extends Authenticatable implements MustVerifyEmail
|
||||
*/
|
||||
public function getUsedCapacityAttribute(): int
|
||||
{
|
||||
return $this->filesWithTrashed
|
||||
->map(fn($item) => $item->getRawOriginal())->sum('filesize');
|
||||
return DB::table('files')
|
||||
->where('user_id', $this->id)
|
||||
->sum('filesize');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user