@extends('dashboard.layouts.master') @section('title', 'Offer Details | Admin Panel') @push('after-styles') @endpush @section('content') @can('offer.show', $offer)
{{-- ── Page Header ── --}}

Offer Details

Dashboard / Offer Management / {{ $offer->title ?? 'Offer #'.$offer->id }}
{{-- ── Status Strip ── --}} @php $status = $offer->admin_offer_status ?? 1; $statusMap = [ 1 => ['label'=>'Pending', 'strip'=>'pending', 'pill'=>'pill-pending'], 2 => ['label'=>'Approved', 'strip'=>'approved', 'pill'=>'pill-approved'], 3 => ['label'=>'Rejected', 'strip'=>'rejected', 'pill'=>'pill-rejected'], 5 => ['label'=>'Under Review', 'strip'=>'under-review', 'pill'=>'pill-under-review'], ]; $si = $statusMap[$status] ?? $statusMap[1]; $meta = is_array($offer->meta_data) ? $offer->meta_data : (is_string($offer->meta_data) ? json_decode($offer->meta_data, true) : []); $meta = $meta ?: []; $typeId = (int) $offer->offer_type_id; @endphp
Offer Status:  {{ $si['label'] }} @if($offer->admin_reviewed_at) — {{ \Carbon\Carbon::parse($offer->admin_reviewed_at)->format('d M Y, H:i') }} @endif
@if($offer->reviewer_name) Reviewed by: {{ $offer->reviewer_name }} @endif
{{-- ── Alerts ── --}} @if($status == 3 && $offer->admin_rejection_reason)
cancel Rejection Reason: {{ $offer->admin_rejection_reason }}
@endif @if($status == 5 && $offer->admin_review_notes)
rate_review Review Notes: {{ $offer->admin_review_notes }}
@endif {{-- ═══════════════════════════════════════ SECTION 1 — BASIC INFO ════════════════════════════════════════ --}}
info
Basic Information
Offer Title
Offer Type
@php $typeColors = [ 1 => '#1565c0', 2 => '#2e7d32', 3 => '#e65100', 4 => '#d32f2f', 5 => '#6a1b9a', ]; $tc = $typeColors[$typeId] ?? '#555'; @endphp {{ $offer->offer_type_name ?? 'N/A' }} @if($offer->is_promoted) star Promoted @endif
Offer ID
Description
{{-- Banner Image --}}
Banner Image
@if($offer->image) @endif
{{-- ═══════════════════════════════════════ SECTION 2 — VALIDITY ════════════════════════════════════════ --}}
event
Validity & Schedule
Start Date
End Date
Time Restriction
{{-- ═══════════════════════════════════════ SECTION 3 — APPLICABILITY ════════════════════════════════════════ --}}
business
Applicability
Business Name
Owner Name
Owner Email
Applicable Branches
@forelse($offer->branches as $branch) store {{ $branch->branch_name }} @empty All branches @endforelse
User Type
@php $userTypes = is_array($offer->user_type) ? $offer->user_type : []; @endphp @forelse($userTypes as $ut) {{ $ut }} @empty Not specified @endforelse
Customer Eligibility
@php $eligibility = is_array($offer->customer_eligibility) ? $offer->customer_eligibility : []; @endphp @forelse($eligibility as $ce) {{ $ce }} @empty Not specified @endforelse
{{-- ═══════════════════════════════════════ SECTION 4 — LIMITS ════════════════════════════════════════ --}}
tune
Limits & Quantities
{{ $offer->purchase_quantity ?? '—' }}
Purchase Quantity
{{ $offer->stock_limit ?? '∞' }}
Stock Limit
{{ $offer->reward_point_ratio ?? $offer->points_required ?? '—' }}
Reward Points
{{ $offer->usage_limit ?? '—' }}
Usage Limit
{{-- ═══════════════════════════════════════ SECTION 5 — TYPE-SPECIFIC DETAILS ════════════════════════════════════════ --}} @php $typeClasses = [ 1 => 'product-discount', 2 => 'general-discount', 3 => 'time-based', 4 => 'limited-coupon', 5 => 'buy-x-get-y', ]; $typeClass = $typeClasses[$typeId] ?? ''; @endphp
category
Type-Specific Details — {{ $offer->offer_type_name ?? 'Unknown' }}
@switch($typeId) {{-- ── Product Discount (1) ── --}} @case(1)
Product List (Required to Purchase)
@forelse($offer->products as $p) shopping_cart Product ID: {{ $p->product_id }} @empty No products assigned @endforelse
@break {{-- ── General Discount (2) ── --}} @case(2)
{{ $meta['discount_value'] ?? '—' }}%
Discount Value
{{ $meta['min_order_amount'] ?? '—' }}
Min Order Amount
@break {{-- ── Time-Based Offer (3) ── --}} @case(3)
From Time
To Time
Discount Type
{{ $meta['discount_value'] ?? '—' }}
Discount Value
Applicable Days
@php $days = $meta['applicable_days'] ?? []; @endphp @forelse($days as $day) {{ $day }} @empty All days @endforelse
@break {{-- ── Limited Coupon (4) ── --}} @case(4)
{{ $meta['total_coupons'] ?? '—' }}
Total Coupons
{{ $meta['regular_price'] ?? '—' }}
Regular Price
{{ $meta['coupon_price'] ?? '—' }}
Coupon Price
Product Name
@break {{-- ── Buy X Get Y (5) ── --}} @case(5)
{{ $meta['buy_quantity'] ?? '—' }}
Buy Quantity (X)
Category ID
Product Name
Free Products (Get Y)
@forelse($offer->freeProducts as $p) card_giftcard Product ID: {{ $p->product_id }} @empty No free products assigned @endforelse
@break @default

No type-specific details available for this offer type.

@endswitch {{-- Products/Free Products for non-type-5 offers that still have them --}} @if($typeId != 1 && $typeId != 5 && $offer->products->count() > 0)
Associated Products
@foreach($offer->products as $p) Product ID: {{ $p->product_id }} @endforeach
@endif
{{-- ═══════════════════════════════════════ SECTION 6 — META DATA (DEBUG) ════════════════════════════════════════ --}}
code
Raw Meta Data (Debug)
expand_more Toggle raw JSON
{{-- ── Terms & Conditions ── --}} @if($offer->terms_conditions)
gavel
Terms & Conditions
@endif {{-- ═══════════════════════════════════════ ACTIONS ════════════════════════════════════════ --}} @can('offer.approve', $offer)
admin_panel_settings Actions
{{-- Approve --}} @if($status != 2)
Offer goes live and becomes visible to all users immediately.
@endif {{-- Reject --}} @if($status != 3)
Business owner receives a notification with the rejection reason.
@endif {{-- Hold on Review --}} @if($status != 5)
Place the offer under review for further investigation.
@endif
{{-- Offer Governance Rules ── --}}
info Offer Governance Rules
  • Admin can approve or reject offers only — offer content cannot be modified by admin.
  • Any changes to offer content require business owner resubmission.
  • Once approved, the offer is immediately live and visible to end users.
  • Business owners must manually deactivate expired or ended offers.
  • Approved offer followers will receive a notification when the offer goes live.
@endcan
{{-- end box-body --}}
{{-- end box --}}
{{-- ═══════════════════════════════════════ MODALS ════════════════════════════════════════ --}} {{-- Approve Modal --}} {{-- Reject Modal --}} {{-- Hold Modal --}} {{-- Image Viewer Modal --}} @else @endcan @endsection @push('after-scripts') @endpush