@extends('layouts.admin') @section('title', $coupon ? __('Edit coupon') : __('New coupon')) @section('content') @php $c = $coupon; $dt = fn ($v) => $v ? \Illuminate\Support\Carbon::parse($v)->format('Y-m-d\TH:i') : ''; @endphp ← {{ __('Coupons') }}

{{ $c ? __('Edit coupon') : __('New coupon') }}

@csrf @if ($c) @method('PUT') @endif
{{-- Who can use this coupon: everyone, or only the customers ticked below. --}} @php $aud = old('audience', count($picked) ? 'selected' : 'all'); $pickedNow = array_map('intval', (array) old('customers', $picked)); @endphp
{{ __('Who can use it') }}
0 {{ __('selected') }}
    @forelse ($customers as $u)
  • @empty
  • {{ __('No customers yet.') }}
  • @endforelse
{{ __('Save coupon') }}
@push('scripts') @endpush @if ($c && $c->is_active)
@csrf{{ __('Notify customers now') }}
@endif @if ($c)
@csrf @method('DELETE'){{ __('Delete coupon') }}
@endif @endsection