@php $tz = config('app.display_timezone'); $size = function (?int $bytes): string { if ($bytes === null) { return __('Not available'); } foreach (['B', 'KB', 'MB', 'GB'] as $unit) { if ($bytes < 1024 || $unit === 'GB') { return ($unit === 'B' ? $bytes : number_format($bytes, 1)).' '.$unit; } $bytes /= 1024; } return ''; }; $cards = [ ['label' => __('Files'), 'value' => number_format((int) $totals->files), 'icon' => 'paper-clip', 'accent' => '#6366f1', 'sub' => __('On CRM records')], ['label' => __('Uploaded'), 'value' => $size((int) $totals->bytes), 'icon' => 'cloud-arrow-up', 'accent' => '#0ea5e9', 'sub' => __('Stored privately')], ['label' => __('Links'), 'value' => number_format((int) $totals->links), 'icon' => 'link', 'accent' => '#10b981', 'sub' => __('Kept elsewhere, such as Drive')], ]; @endphp
@foreach ($cards as $m)

{{ $m['label'] }}

{{ $m['value'] }}

{{ $m['sub'] }}
@endforeach

{{ __('All files') }}

{{ __('Opening a file checks you may see the record it belongs to.') }}

@forelse ($files as $file) @php $parent = $file->attachable; $parentKey = $directory->keyFor($file->attachable_type); $open = $directory->url($file); @endphp @empty @endforelse
{{ __('File') }} {{ __('Category') }} {{ __('Attached to') }} {{ __('Added by') }} {{ __('Added') }} {{ __('Size') }} {{ __('Actions') }}
{{ $file->original_name ?: $file->external_url }} @if ($file->description)

{{ $file->description }}

@endif
{{ __(\App\Models\Crm\Attachment::CATEGORIES[$file->category] ?? 'Other') }} {{ $directory->singular((string) $parentKey) }} @if ($parent) @php $parentUrl = $directory->url($parent); @endphp @if ($parentUrl) {{ $directory->name($parent) }} @else {{ $directory->name($parent) }} @endif @else {{ __('A deleted record') }} @endif {{ $file->uploader?->name ?? __('A former member') }} {{ $file->created_at?->copy()->timezone($tz)->format('j M Y') }} {{ $file->isExternal() ? __('Link') : $size($file->size) }}
{{ __('Open') }} @can('delete', $file) @endcan
@if ($hasFilters)
@else @endif
@if ($files->hasPages())
{{ $files->links() }}
@endif