team folder browsing with static team folder details

This commit is contained in:
Peter Papp
2021-08-31 14:08:47 +02:00
parent f44e262d6e
commit a3516769de
46 changed files with 317 additions and 225 deletions

View File

@@ -1,5 +1,4 @@
<?php
namespace App\Users\Models;
use ByteUnits\Metric;
@@ -96,7 +95,7 @@ class User extends Authenticatable implements MustVerifyEmail
{
$is_storage_limit = get_settings('storage_limitation') ?? 1;
if (!$is_storage_limit) {
if (! $is_storage_limit) {
return [
'used' => $this->usedCapacity,
'used_formatted' => Metric::bytes($this->usedCapacity)->format(),
@@ -104,7 +103,7 @@ class User extends Authenticatable implements MustVerifyEmail
}
return [
'used' => (float)get_storage_fill_percentage($this->usedCapacity, $this->settings->storage_capacity),
'used' => (float) get_storage_fill_percentage($this->usedCapacity, $this->settings->storage_capacity),
'used_formatted' => get_storage_fill_percentage($this->usedCapacity, $this->settings->storage_capacity) . '%',
'capacity' => $this->settings->storage_capacity,
'capacity_formatted' => format_gigabytes($this->settings->storage_capacity),
@@ -117,7 +116,7 @@ class User extends Authenticatable implements MustVerifyEmail
public function getUsedCapacityAttribute(): int
{
return $this->filesWithTrashed
->map(fn($item) => $item->getRawOriginal())->sum('filesize');
->map(fn ($item) => $item->getRawOriginal())->sum('filesize');
}
/**