{{-- resources/views/pricing/promotions.blade.php --}} @extends('layouts.app') @section('title', 'Promotions') @section('page_title', 'Promotions') @section('page_subtitle', 'Promo codes, discounts and special offers') @section('content')
← Pricing
{{-- Promotions List --}}
Promotions {{ $promotions->count() }} total
@if($promotions->isEmpty())

No promotions yet

Create promo codes and special offers

@else
@foreach($promotions as $promo) @php $isActive = $promo->is_active && now()->between($promo->valid_from, $promo->valid_to); $isExpired = now()->gt($promo->valid_to); @endphp
{{ $promo->name }} @if($promo->code) {{ $promo->code }} @endif @if($isExpired) Expired @elseif(!$promo->is_active) Inactive @else Active @endif
{{-- Discount --}} @if($promo->discount_type === 'percentage') {{ $promo->discount_value }}% off @elseif($promo->discount_type === 'fixed') ${{ number_format($promo->discount_value, 2) }} off @else Override: ${{ number_format($promo->discount_value, 2) }} @endif {{-- Validity --}} {{ $promo->valid_from->format('d M') }} – {{ $promo->valid_to->format('d M Y') }} @if($promo->min_stay_nights) Min {{ $promo->min_stay_nights }} nights @endif {{-- Usage --}} @if($promo->max_uses) {{ $promo->use_count ?? 0 }} / {{ $promo->max_uses }} used @else {{ $promo->use_count ?? 0 }} used @endif {{-- Applies to --}} @if($promo->roomCategory) {{ $promo->roomCategory->name }} only @endif @if($promo->ratePlan) {{ $promo->ratePlan->code }} plan only @endif
@if($promo->description)
{{ $promo->description }}
@endif
@csrf @method('DELETE')
@endforeach
@endif
{{-- Add Promotion --}}
Create Promotion
@csrf
@error('name')
{{ $message }}
@enderror
Leave empty for automatic discount (no code required)
@error('code')
{{ $message }}
@enderror
@error('discount_value')
{{ $message }}
@enderror
@error('valid_from')
{{ $message }}
@enderror
@error('valid_to')
{{ $message }}
@enderror
nts
{{-- Edit Promotion Modal --}} @endsection @push('scripts') @endpush