@props(['packages']) @php /* | Every figure here is derived from the collection the controller already | loaded, so the header costs exactly zero extra queries. */ $total = $packages->count(); $active = $packages->where('is_active', true)->count(); $licenses = (int) $packages->sum('licenses_count'); // "Starting price" means the cheapest thing a customer can actually buy. // A Rs 0 package is a custom-quote placeholder, not an entry price, so it // is excluded - otherwise this card reads "Rs 0" on every install. $paid = $packages->where('price', '>', 0); $starting = (float) ($paid->min('price') ?? 0); $average = $total > 0 ? (float) $packages->avg('price') : 0.0; $longest = (int) ($packages->max('duration_days') ?? 0); @endphp
merge(['class' => 'grid grid-cols-2 gap-3 sm:grid-cols-3 xl:grid-cols-6']) }}>