@extends('admin.layout') @section('title', $offer ? $offer->name : 'New offer') @section('content') @php $v = fn ($k, $d = '') => old($k, $offer ? ($offer->{$k} ?? $d) : $d); $type = old('condition_type', $offer->condition_type ?? 'orders'); $isActive = session()->hasOldInput() ? old('is_active') : ($offer ? $offer->is_active : true); $isRepeat = session()->hasOldInput() ? old('repeatable') : ($offer ? $offer->repeatable : false); @endphp

{{ $offer ? $offer->name : 'New offer' }}

← All offers
@csrf @if($offer) @method('PUT') @endif

With dates, only orders placed between them count towards the offer.

@if($offer) @endif

@if($offer)
@csrf @method('DELETE')
@endif @if($offer)

Customers who got this offer ({{ $redemptions->count() }})

@forelse($redemptions as $r) @empty @endforelse
DateCustomerPhoneOrderNote
{{ $r->given_on->format('d M Y') }} {{ $r->customer_name }} {{ $r->phone }} {{ $r->order_no ? '#'.$r->order_no : '—' }} {{ $r->note }}
@csrf @method('DELETE')
Nobody has received this offer yet.
@if($offer->condition_type !== 'manual')

Customers who qualify now and have not got it yet ({{ $eligible->count() }})

@forelse($eligible as $e) @empty @endforelse
CustomerPhoneAvailableProgress
{{ $e['name'] }} {{ $e['phone'] }} {{ $e['available'] }} {{ $e['progress'] }}
No one is waiting for this offer.

Open a customer to give them the offer.

@endif @endif @endsection