whereHas('transfer', fn ($q) => $q ->where('user_id', $account->id) ->where('status', Transfer::STATUS_ACTIVE)) ->with('transfer') ->latest() ->paginate(30); $storageBytes = Transfer::query() ->where('user_id', $account->id) ->where('status', Transfer::STATUS_ACTIVE) ->sum('storage_bytes'); return view('transfer.files.index', [ 'files' => $files, 'storageBytes' => (int) $storageBytes, 'storageGb' => round($storageBytes / (1024 * 1024 * 1024), 2), 'pricePerGb' => (float) config('transfer.price_per_gb_month', 0.15), ]); } }