@php $editing = $plan !== null; $burstPartial = collect([$burst_limit, $burst_threshold, $burst_time]) ->map(fn ($v) => trim((string) $v) !== '') ->pipe(fn ($f) => $f->contains(true) && $f->contains(false)); @endphp

{{ $editing ? __('Edit') : __('Create') }} {{ __('a') }} {{ __('package.') }}

{{ __('Speed limits, scheduling, and NAS restrictions.') }}

{{-- ── Identity ─────────────────────────────────────────────── --}}
{{ __('Identity') }}
@foreach (\App\Models\PackageList::AVAILABILITY as $key => $label) @endforeach
@switch($availability) @case('live') {{ __('Visible to customers and accepting signups.') }} @break @case('hidden') {{ __('Existing subscribers keep it; nobody new can buy it.') }} @break @default {{ __('Withdrawn — nobody can buy or use it.') }} @endswitch
{{-- ── Pricing ──────────────────────────────────────────────── --}}
{{ __('Pricing') }}
{{ __('Ksh') }}
@if ($type !== 'trial' && (int) $price === 0 && $price !== '') {{-- Not a validation error: a free plan is legitimate, but it is almost never what someone meant to type. --}} {{ __('Priced at zero — this plan gives away internet for free. Set the type to Trial if that is the intent.') }} @endif
{{ __('How long the plan grants access from activation. This drives the router limit, the remembered-device window and the expiry sweep.') }}
{{-- ── Speed ────────────────────────────────────────────────── --}}
{{ __('Speed') }}
{{ __('MikroTik rate-limit string, e.g. 5M/5M (down/up).') }}
{{ __('How many devices may share one login at the same time.') }}
{{-- ── Burst ────────────────────────────────────────────────── --}}
{{ __('Burst') }}
{{ __('optional') }}

{{ __('MikroTik burst lets a subscriber briefly exceed their rate-limit. Fill all three to enable, or leave all blank to disable.') }}

@if ($burstPartial) {{-- RouterOS ignores an incomplete burst without complaining, so say it here rather than let it look configured. --}} {{ __('Burst needs all three values. As it stands none of them will be applied.') }} @endif
{{ __('seconds') }}
{{-- ── Fair use ─────────────────────────────────────────────── --}}
{{ __('Fair Use Policy') }}
@if ($fup_enabled)
MB
@if ($fup_action === 'throttle')
@endif
@endif
{{-- ── Schedule ─────────────────────────────────────────────── --}}
{{ __('Schedule') }}
@if ($schedule_enabled)
{{ __('A "to" earlier than "from" is read as crossing midnight.') }}
@endif
{{-- ── NAS restriction ──────────────────────────────────────── --}}
{{ __('NAS restriction') }}
{{ __('optional') }}

{{ __('Limit this plan to specific routers. Leave empty to allow on every NAS.') }}

@if ($this->routers->isEmpty())

{{ __('No routers linked yet.') }}

@else
@foreach ($this->routers as $router) @endforeach
@endif {{-- The per-item message too: a bad id lands on `nas_router_ids.0`, and without this the form refused to save while showing nothing at all. --}} @foreach ($errors->get('nas_router_ids.*') as $messages) @foreach ($messages as $message)
{{ $message }}
@endforeach @endforeach
{{ __('Cancel') }}