@extends('layouts.admin') @section('title', $supermarket->name . ' - Promotions Management') @section('content')
{{ $supermarket->name }}
| Promotion | Type | Discount | Duration | Usage | Status | Actions |
|---|---|---|---|---|---|---|
|
{{ $promotion->promotion_title }}
{{ Str::limit($promotion->promotion_description, 40) }}
|
{{ ucfirst(str_replace('_', ' ', $promotion->promotion_type)) }} | @if($promotion->promotion_type === 'percentage') {{ $promotion->discount_percentage }}% @elseif($promotion->promotion_type === 'fixed_amount') ${{ number_format($promotion->discount_amount, 2) }} @else {{ $promotion->special_offer_details }} @endif |
Start:
@if($promotion->start_datetime)
{{ $promotion->start_datetime->format('M d, Y H:i') }}
@else
Not set
@endif
End: @if($promotion->end_datetime) {{ $promotion->end_datetime->format('M d, Y H:i') }} @else Not set @endif |
{{ $promotion->redemption_count }}
@if($promotion->max_uses)
/ {{ $promotion->max_uses }}
@endif
@if($promotion->max_uses)
|
@php $now = now(); $startDate = $promotion->start_datetime ? $promotion->start_datetime : null; $endDate = $promotion->end_datetime ? $promotion->end_datetime : null; $isActive = $promotion->is_active && $startDate && $endDate && $startDate <= $now && $endDate >= $now; $isUpcoming = $promotion->is_active && $startDate && $startDate > $now; $isExpired = $endDate && $endDate < $now; @endphp @if($isActive) Active @elseif($isUpcoming) Upcoming @elseif($isExpired) Expired @else Inactive @endif |
|
@if(request('status')) No promotions match your current filter. @else Create your first promotion to attract customers and boost sales. @endif