@extends('layouts.app') @section('content')
{{-- Header --}}

Eventos

Gestiona tus eventos, pagos y estados
@if(session('success'))
{{ session('success') }}
@endif {{-- Filtros (acordeón para móvil) --}}

@if(request()->query()) @endif
{{-- MOBILE: cards --}}
@forelse($eventos as $ev) @php $estado = $ev->estado ?? 'pendiente'; $badge = match($estado) { 'confirmado' => 'text-bg-success', 'cancelado' => 'text-bg-danger', default => 'text-bg-warning', }; $deuda = $ev->deuda ?? max(0, (int)$ev->total - (int)$ev->pagado); @endphp
{{ $ev->titulo }}
{{ $ev->fecha_evento?->format('d-m-Y') ?? '—' }} @if(!empty($ev->hora_inicio)) · {{ substr($ev->hora_inicio,0,5) }} @endif
Cliente: {{ $ev->cliente_nombre ?? '—' }}
{{ ucfirst($estado) }}

Total
${{ number_format($ev->total ?? 0, 0, ',', '.') }}
Pagado
${{ number_format($ev->pagado ?? 0, 0, ',', '.') }}
Deuda
${{ number_format($deuda, 0, ',', '.') }}
Editar
@csrf @method('DELETE')
@empty
No hay eventos.
@endforelse
{{-- DESKTOP: tabla --}}
@forelse($eventos as $ev) @php $deuda = $ev->deuda ?? max(0, (int)$ev->total - (int)$ev->pagado); @endphp @empty @endforelse
Fecha Título Cliente Estado Total Pagado Deuda Acciones
{{ $ev->fecha_evento?->format('d-m-Y') ?? '—' }} {{ $ev->titulo }} {{ $ev->cliente_nombre ?? '—' }} {{ ucfirst($ev->estado ?? 'pendiente') }} ${{ number_format($ev->total ?? 0, 0, ',', '.') }} ${{ number_format($ev->pagado ?? 0, 0, ',', '.') }} ${{ number_format($deuda, 0, ',', '.') }} Editar
@csrf @method('DELETE')
No hay eventos.
{{ $eventos->links() }}
@endsection