@extends('layouts.app') {{-- Use your main layout file --}} @section('title', 'Campaigns List') @section('content') {{-- Alpine component manages view mode and selected campaigns --}}
{{-- Header Row: Title, Add Buttons, View Toggle --}}

Campaigns

{{-- Create Button --}} Create New Campaign {{-- View Mode Toggle Buttons --}}
{{-- List View Button --}} {{-- Grid View Button --}}
{{-- >>> START: Search Form <<< --}}
{{-- Add other filter inputs here if needed --}}
Clear
{{-- >>> END: Search Form <<< --}} {{-- Bulk Action Form for Campaigns --}} {{-- Ensure controller method exists for this route --}}
@csrf @method('DELETE') {{-- Bulk Action Bar --}}
{{-- Container for List View (Table) --}}
{{-- Checkbox header --}} @forelse ($campaigns as $campaign) {{-- Actions Cell - With Icons + Text --}} @empty @endforelse
Image Title Type Status Created Actions
@if ($campaign->image_path) {{ $campaign->title }} @else
@endif
{{ $campaign->title }}
{{ $campaign->type }} @if ($campaign->enabled) Enabled@elseDisabled @endif {{ $campaign->created_at->format('Y-m-d') }}
View Edit @csrf @method('DELETE')
No campaigns found. Create one?
{{-- Container for Grid/Card View --}}
@forelse ($campaigns as $campaign) {{-- Campaign Card --}}
{{-- Checkbox Overlay --}}
{{-- Image Link Container --}} @if ($campaign->image_path) {{ $campaign->title }} @else
@endif
{{-- Content --}}

{{ $campaign->title }}

@if ($campaign->enabled) Enabled @else Disabled @endif {{ $campaign->type }}

Created {{ $campaign->created_at->diffForHumans() }}

{{ $campaign->products_count }} Product(s) Associated
@if ($campaign->shippingAddress) Ships to: {{ $campaign->shippingAddress->city }}, {{ $campaign->shippingAddress->state }} @else No Address Set @endif
{{-- Actions - With Icons + Text --}}
View Edit
@csrf @method('DELETE')
@empty {{-- Empty state for grid view --}}

No campaigns found.

Create one?
@endforelse
{{-- End Bulk Action Form --}} {{-- Pagination Links --}}
@if (isset($campaigns) && $campaigns instanceof \Illuminate\Pagination\LengthAwarePaginator) {{ $campaigns->appends(request()->query())->links() }} @endif
{{-- End Alpine Component --}} @endsection