{{-- Feature checklist inside a plan card. Driven by Package::featureCatalog() so it lists EVERYTHING the plan grants. The first few show by default; the rest collapse behind a pure-CSS "Show all" toggle (a hidden peer checkbox) so long plans don't make giant cards. @param $p Package @param $iconCls CSS class for the check ticks @param $textCls CSS class for the feature text (dark vs light card) @param $moreCls CSS class for the show-more link --}} @php $catalog = \App\Models\Package::featureCatalog(); $textCls = $textCls ?? 'text-ink-700'; $moreCls = $moreCls ?? 'text-wa-deep'; $tick = ''; $fmt = function ($v) { if ($v === null || $v === '') { return null; } if ((int) $v === 0) { return 'Unlimited'; } if ($v >= 1000) { return number_format($v / 1000, $v >= 100000 ? 0 : 1) . 'k'; } return number_format($v); }; // Build the full ordered list of rendered
  • rows. $items = []; foreach ($catalog['limits'] as $key => $label) { $v = $p->{$key} ?? null; if ($v !== null && $v !== '') { $items[] = '
  • ' . $tick . '' . e($fmt($v)) . ' ' . e($label) . '
  • '; } } foreach ($catalog['capabilities'] as $key => $label) { if ((bool) ($p->{$key} ?? false)) { $items[] = '
  • ' . $tick . '' . e($label) . '
  • '; } } $visibleCount = 7; $first = array_slice($items, 0, $visibleCount); $rest = array_slice($items, $visibleCount); $chevDown = ''; $chevUp = ''; @endphp @if (!empty($rest)) {{-- Hidden checkbox is the peer; the rest-list + both labels are its siblings. --}} @endif