@php $rows = $this->rows; $counts = $this->counts; $usage = $this->usage; $all = $this->all; @endphp

{{ __('Your') }} {{ __('packages.') }}

{{ __('Every plan you offer, grouped by connection type.') }} {{ trans_choice('{0}Nothing active yet.|{1}One active across the network.|[2,*]:count active across the network.', $counts['all'], ['count' => $counts['all']]) }}

{{ __('New package') }}
@if ($flash)
{{ $flash }}
@endif {{-- ── Summary ────────────────────────────────────────────────── --}} @php $live = $all->where('availability', 'live')->count(); $hidden = $all->where('availability', 'hidden')->count(); $off = $all->where('availability', 'off')->count(); $onPlans = array_sum($usage['subscribers']); @endphp
{{ __('All plans') }} {{ $counts['all'] }} {{ trans_choice('{0}none withdrawn|{1}:count withdrawn|[2,*]:count withdrawn', $off, ['count' => $off]) }}
{{ __('Active') }} {{ $live }} {{ __('currently offering') }}
{{ __('Unlisted') }} {{ $hidden }} {{ __('not listed publicly') }}
{{ __('Withdrawn') }} {{ $off }} {{ __('not open for sign-up') }}
{{ __('Subscribers') }} {{ $onPlans }} {{ __('assigned to plans') }}
{{-- ── Filters ────────────────────────────────────────────────── --}}
@foreach (\App\Models\PackageList::TYPES as $key => $label) @endforeach
{{-- ── Table ──────────────────────────────────────────────────── --}}
@forelse ($rows as $plan) @php $subs = $usage['subscribers'][$plan->id] ?? 0; $rev = (float) ($usage['revenue'][$plan->id] ?? 0); $rate = $plan->mikrotik_rate_limit ?: $plan->speed; @endphp @empty @endforelse
{{ __('Plan') }} {{ __('Type') }} {{ __('Price') }} {{ __('Subscribers') }} {{ __('Revenue 30d') }} {{ __('Status') }}
{{-- The whole cell is the link, so hitting the row anywhere in the name column opens the plan. --}} {{ $plan->package }} @if ($plan->is_popular) {{ __('POPULAR') }} @endif @if ($plan->is_on_offer) {{ __('OFFER') }} @endif @if ($rate){{ $rate }}@endif @if ($rate && $plan->durationShort()) · @endif @if ($plan->durationShort()){{ $plan->durationShort() }}@endif @if ($plan->shared_users > 1) +{{ $plan->shared_users }} {{ __('devices') }} @endif @if (! $plan->duration_seconds) {{-- Loud on purpose: a plan with no length gets no expiry and no cookie, which is how somebody stays online after their time is up. --}} {{ __('no duration set') }} @endif {{ Str::upper($plan->typeLabel()) }} {{ __('Ksh') }} {{ number_format((float) $plan->price) }} {{ $subs ?: '—' }} {{ $rev > 0 ? __('Ksh').' '.number_format($rev) : '—' }} {{ Str::upper(\App\Models\PackageList::AVAILABILITY[$plan->availability] ?? $plan->availability) }}
@if ($search !== '') {{ __('Nothing matches ":term".', ['term' => $search]) }} @elseif ($tab !== 'all') {{ __('No :type plans yet.', ['type' => Str::lower(\App\Models\PackageList::TYPES[$tab] ?? $tab)]) }} @else {{ __('No packages yet — create your first one.') }} @endif
{{-- ── Delete confirmation ────────────────────────────────────── --}} @if ($confirmingDelete) @php $doomed = $all->firstWhere('id', $confirmingDelete); @endphp
{{ __('Delete :plan?', ['plan' => $doomed?->package]) }}

{{ __('This cannot be undone. If anyone is still on this plan it will be withdrawn instead, so nobody loses what they paid for.') }}

@endif