@extends('layouts.app') @section('content') @php $isAdmin = optional(auth()->user()->role)->role_name === 'admin'; @endphp @if(session('success'))
βœ…
Success
{{ session('success') }}
@endif
{{-- HEADER --}}

{{ $isAdmin ? 'All Packages' : 'Packages' }}

{{ $packages->total() }} Total
@if(!$isAdmin) Add Package @endif
{{-- ACTIVE FILTER CHIPS --}} @if(request()->hasAny(['name','destination_id','date_from','date_to','agency_id']))
@if(request()->filled('name')) πŸ“¦ Name: {{ request('name') }} × @endif @if(request()->filled('agency_id') && $isAdmin) 🏒 Agency: {{ $agencies->firstWhere('id', request('agency_id'))?->name }} × @endif @if(request()->filled('destination_id')) πŸ—ΊοΈ Destination: {{ $destinations->firstWhere('id', request('destination_id'))?->name }} × @endif @if(request()->filled('date_from')) πŸ“… From: {{ \Carbon\Carbon::parse(request('date_from'))->format('d M Y') }} × @endif @if(request()->filled('date_to')) πŸ“… To: {{ \Carbon\Carbon::parse(request('date_to'))->format('d M Y') }} × @endif Clear all
@endif {{-- TABLE --}}
@if($isAdmin) @endif @forelse($packages as $key => $package) @if($isAdmin) @endif @empty @endforelse
SL Photo Package Name DestinationAgencyPrice Action
{{ $packages->firstItem() + $key }} @if($package->photo) @else
No photo
@endif
{{ $package->name }}
@if($package->short_description)
{{ $package->short_description }}
@endif
{{ $package->created_at->format('d M Y') }}
@if($package->holidaydestination) {{ $package->holidaydestination->name }} @else β€” @endif {{ optional($package->agency)->name ?? 'β€”' }} @if($package->price_min !== null) @if($package->price_max === null) ${{ number_format($package->price_min, 2) }} @else ${{ number_format($package->price_min, 2) }} – ${{ number_format($package->price_max, 2) }} @endif USD @else β€” @endif
@if(!$isAdmin)
@csrf @method('DELETE')
@endif
@if(request()->hasAny(['name','destination_id','date_from','date_to','agency_id'])) No packages found matching your filters.
Clear Filters @else No packages added yet. @endif
{{-- PAGINATION --}} @if($packages->hasPages()) @endif
{{-- VIEW MODALS --}} @foreach($packages as $package) @endforeach {{-- ADVANCED FILTER MODAL --}}
Filter Packages
@if($isAdmin)
@endif
@endsection