@props([]) {{-- | The package editor's fields — one definition, two hosts. | | The standalone page (packages/form.blade.php) and the modal on the index both | render this, so a field can never exist on one and not the other. Both hosts | provide an Alpine `form` object with the same shape, and every input carries | BOTH a server-rendered value and an x-model: the value is what a browser with | no JavaScript submits, the x-model is what the modal binds to. | | Requires in scope: $package (a LicensePackage, possibly unsaved). --}} @php $billingPeriods = [ 'monthly' => ['Monthly', 'Billed every month'], 'quarterly' => ['Quarterly', 'Billed every three months'], 'semiannual' => ['Semiannual', 'Billed twice a year'], 'annual' => ['Annual', 'Billed once a year'], 'custom' => ['Custom', 'Priced per agreement'], ]; $old = fn (string $field, $fallback = null) => old($field, $package->$field ?? $fallback); @endphp

{{-- The slug is derived from the name server-side. Showing it live stops the rename that silently changes a package's identifier from being a surprise. --}} URL slug {{ $package->slug ?: '—' }}

@error('name')

{{ $message }}

@enderror @error('slug')

{{ $message }}

@enderror

Blank means the owner sets the term on each license.

@error('duration_days')

{{ $message }}

@enderror

Works out at Rs per day. Set a duration to see the daily rate.

@error('price')

{{ $message }}

@enderror
Billing cycle * {{-- Radio cards rather than a select: five options with an explanation each, and the choice stays visible while the price is set. --}}
@foreach ($billingPeriods as $value => [$label, $description]) @endforeach
@error('billing_period')

{{ $message }}

@enderror

Lower numbers appear first, here and on the license form.

@error('sort_order')

{{ $message }}

@enderror
Availability