@extends('layouts.admin') @section('title', __('Storage Analytics')) @section('content')

{{ __('Storage Analytics') }}

{{ number_format($totalStorage / 1024 / 1024, 2) }} MB

{{ __('Total Storage Used') }}

{{ $storageByType->sum('count') }}

{{ __('Total Files') }}

{{ $storageByType->count() }}

{{ __('File Types') }}

@if($storageQuota > 0)

{{ number_format(($totalStorage / $storageQuota) * 100, 1) }}%

{{ __('Quota Used') }}

@else

--

{{ __('No Quota Set') }}

@endif
@if($storageQuota > 0)
{{ __('Storage Quota Usage') }}
@php $usagePercentage = ($totalStorage / $storageQuota) * 100; $progressClass = $usagePercentage > 90 ? 'bg-danger' : ($usagePercentage > 75 ? 'bg-warning' : 'bg-success'); @endphp
{{ number_format($usagePercentage, 1) }}% ({{ number_format($totalStorage / 1024 / 1024, 2) }} MB / {{ number_format($storageQuota / 1024 / 1024, 2) }} MB)
@endif
{{ __('Storage Distribution by File Type') }}
{{ __('Storage Growth (Last 30 Days)') }}
{{ __('Storage Usage by File Type') }}
@foreach($storageByType as $type) @endforeach
{{ __('File Type') }} {{ __('File Count') }} {{ __('Storage Used') }} {{ __('Average File Size') }} {{ __('Percentage') }}
{{ ucfirst($type['type']) }} {{ number_format($type['count']) }} {{ $type['size_formatted'] }} {{ $type['count'] > 0 ? number_format($type['size'] / $type['count'] / 1024, 2) . ' KB' : '0 KB' }} @if($totalStorage > 0) {{ number_format(($type['size'] / $totalStorage) * 100, 1) }}% @else 0% @endif
{{ __('Largest Files') }}
@forelse($largestFiles as $file) @empty @endforelse
{{ __('File Name') }} {{ __('Type') }} {{ __('Size') }} {{ __('Folder') }} {{ __('Uploaded') }} {{ __('Actions') }}
@if($file->isImage()) @else @endif
{{ Str::limit($file->file_name, 30) }} @if($file->alt_text_en || $file->alt_text_ar)
{{ Str::limit($file->alt_text ?? '', 40) }} @endif
{{ ucfirst($file->file_type) }} {{ $file->getHumanReadableSizeAttribute() }} @if($file->folder) {{ $file->folder->name }} @else {{ __('Root') }} @endif {{ $file->created_at->format('M d, Y') }} {{ __('View') }}
{{ __('No files found') }}
@endsection @push('styles') @endpush @push('scripts') @endpush