@extends('layout') @push('styles') @endpush @section('content') @if (session('success'))
×

{{ __('Success!') }}

{{ session('success') }}

@endif

{{ __('Overview') }}

{{-- Tabs / Filters (All | Published | Postponed | Draft | Paused | Completed | Cancelled) --}}
@php $baseQuery = request()->except(['page', 'status']); $status = request('status', 'all'); @endphp
{{-- Filters Row (search, sort, date) --}}
{{-- Keep status when changing other filters --}} {{-- Search --}} {{-- Sort --}} {{-- Direction --}} {{-- Date (start_date) --}} {{-- Buttons (INLINE on Desktop, WRAP on Mobile) --}}
{{ __('Reset') }}
{{-- Table --}}
@forelse($promos as $promo) @php $percentage = $promo->total_limit && $promo->total_limit > 0 ? ($promo->used_count / $promo->total_limit) * 100 : 0; @endphp @php $revenue = $promo->used_count * $promo->discount_value; @endphp @empty @endforelse
{{ __('Code') }} {{ __('Type') }} {{ __('Discount') }} {{ __('Usage') }} {{ __('Valid Until') }} {{ __('Revenue') }} {{ __('Status') }} {{ __('Applicable To') }}
{{ $promo->name ?? '' }}
{{ trans($promo->discount_type ?? '') }} {{ $promo->discount_value ?? '' }} @if ($promo->discount_type === 'Percentage') % @else {{ getSetting('default_currency') === 'USD' ? '$' : getSetting('default_currency') ?? '' }} @endif
{{ $promo->used_count }}/{{ $promo->total_limit }}
{{ optional($promo->valid_to) ? \Carbon\Carbon::parse($promo->valid_to)->format('M d, Y') : '—' }} {{ $revenue }} {{ getSetting('default_currency') === 'USD' ? '$' : getSetting('default_currency') ?? '' }} @if ( ($promo->valid_to && \Carbon\Carbon::parse($promo->valid_to)->isPast()) || $promo->used_count >= $promo->total_limit ) {{ __('Expired') }} @elseif ($promo->status) {{ __('Active') }} @else {{ __('Inactive') }} @endif @if (($promo->applicability ?? true) == true) @php $events = $promo->events->pluck('title')->take(1)->toArray(); @endphp {{ implode(', ', $events) }} @if ($promo->events->count() > 1) ... @endif @else {{ __('All Events') }} @endif
{{-- Action Trigger --}} {{-- Dropdown Menu --}}
@can('promos.edit') icon {{ __('Edit') }} @endcan @can('promos.destroy')
@csrf @method('DELETE')
@endcan

{{ __('Are you sure?') }}

{{ __('This action cannot be undone.') }}

{{ __('No Promotion Codes found.') }}
{{-- Items per page dropdown --}}
@foreach (request()->except('per_page') as $key => $value) @endforeach
{{-- Pagination Display --}}

{{ __('Page') }} {{ $promos->currentPage() }} {{ __('of') }} {{ $promos->lastPage() }}

{{-- Previous --}} @if ($promos->onFirstPage()) @else icon @endif {{-- Next --}} @if ($promos->currentPage() == $promos->lastPage()) @else icon @endif
{{-- Optional small script: press Enter in search to submit --}} @endsection