@extends('layouts.admin.app') @section('title', 'Offers') @push('style') @endpush @section('content')
@include('admin.layouts.alert')
Pending Review
{{ $counts[\App\Models\Offer::STATUS_PENDING] ?? 0 }}
Approved
{{ $counts[\App\Models\Offer::STATUS_APPROVED] ?? 0 }}
Rejected
{{ $counts[\App\Models\Offer::STATUS_REJECTED] ?? 0 }}

All Offers

@forelse ($offers as $offer) @empty @endforelse
Offer Submitted By Category Price Points Valid Until Status Submitted
@if ($offer->imageUrl()) @else
No image
@endif
{{ $offer->title }}
{{ $offer->brand_name }}{{ $offer->discount_value ? ' · ' . $offer->discount_value : '' }}
{{ $offer->submittedByName() }}
{{ $offer->league->name ?? 'No league' }}
{{ $offer->category->name ?? '—' }}
{{ $offer->currency }} {{ number_format((float) $offer->offer_price, 2) }}
@if ((float) $offer->original_price > (float) $offer->offer_price)
{{ $offer->currency }} {{ number_format((float) $offer->original_price, 2) }}
@endif
{{ (int) $offer->reward_points }} @if ($offer->valid_until) {{ $offer->valid_until->format('d M Y') }} @if ($offer->isExpired())
Expired
@endif @else — @endif
@include('admin.offers.partials._approval-dropdown', ['offer' => $offer]) @if ((int) $offer->status === \App\Models\Offer::STATUS_REJECTED && $offer->rejection_reason)
{{ $offer->rejection_reason }}
@endif
{{ $offer->created_at?->format('d M Y, H:i') }}
No offers found.
{{ $offers->links() }}
@include('admin.offers.partials._modal-approve') @include('admin.offers.partials._modal-reject')
@endsection @php // Cast to object so json_encode keeps the 0/1/2 keys instead of // collapsing the sequential array into a positional JS array. $statusClassMap = (object) [ \App\Models\Offer::STATUS_PENDING => 'pending', \App\Models\Offer::STATUS_APPROVED => 'approved', \App\Models\Offer::STATUS_REJECTED => 'rejected', ]; @endphp @push('script') @endpush