@extends('layouts.admin') @section('title', $isCreate ? 'New discount' : 'Edit discount') @section('content') @php $type = old('type', $discount->type ?? 'percent'); $kind = old('kind', $kind ?? 'code'); $valuePercent = old('value_percent', $type === 'percent' ? rtrim(rtrim(number_format(($discount->value ?? 0) / 100, 2, '.', ''), '0'), '.') : ''); $valueAmount = old('value_amount', $type === 'fixed' ? number_format(($discount->value ?? 0) / 100, 2, '.', '') : ''); $minSubtotal = old('min_subtotal', $discount->min_subtotal_cents ? number_format($discount->min_subtotal_cents / 100, 2, '.', '') : ''); $nav = [ ['basics', 'Basics', 'badge-percent'], ['value', 'Value', 'coins'], ['limits', 'Limits & schedule', 'calendar-clock'], ['combine', 'Combinations', 'layers'], ]; @endphp
@endsection