@extends('layouts.app') @section('titulo', $evento->nombre) @section('breadcrumb') Inicio Eventos {{ $evento->nombre }} @endsection @section('contenido') {{-- Header del evento --}}

{{ $evento->nombre }}

@if($evento->activo) ● ACTIVO @else Inactivo @endif
{{ $evento->tipo }} · {{ \Carbon\Carbon::parse($evento->fecha)->isoFormat('dddd D [de] MMMM [de] YYYY') }} · Countdown: {{ $evento->segundos_cuenta_regresiva }}s
Editar Ir a Sorteos 📄 Reporte
@if($evento->descripcion)
Descripción

{{ $evento->descripcion }}

@endif {{-- Métricas del evento --}}
@php $totalParticipantes = $evento->participantes()->count(); $participantesDisp = $evento->participantes()->where('baneado', false)->count(); $totalPremios = $evento->premios()->count(); $premiosSorteados = $evento->premios()->where('estado', 'sorteado')->count(); $ganadoresTotales = \App\Models\Ganador::whereHas('sorteo', fn($q)=>$q->whereHas('premio', fn($q2)=>$q2->where('evento_id',$evento->id)))->where('estado','ganador')->count(); @endphp @foreach([ ['Participantes', $totalParticipantes, $participantesDisp . ' disponibles'], ['Premios', $totalPremios, $premiosSorteados . ' sorteados'], ['Ganadores', $ganadoresTotales, 'estado: ganador'], ['Sorteos hoy', \App\Models\Sorteo::whereHas('premio', fn($q)=>$q->where('evento_id',$evento->id))->whereDate('created_at', today())->count(), now()->format('d/m/Y')], ] as $m)
{{ $m[0] }}
{{ $m[1] }}
{{ $m[2] }}
@endforeach
{{-- Premios y sorteos --}}
Premios del Evento + Agregar Premio
@forelse($evento->premios()->orderBy('orden')->get() as $premio) @empty @endforelse
Premio Tipo Ganadores Estado Acciones
{{ $premio->emoji }} {{ $premio->nombre }} {{ $premio->tipo_sorteo === 'al_agua' ? 'Al Agua' : 'Normal' }} {{ $premio->cantidad_ganadores }} @if($premio->estado === 'sorteado') ● Sorteado @else ○ Pendiente @endif Editar
No hay premios. Agregar el primero
{{-- Últimos ganadores --}} @php $ganadores = \App\Models\Ganador::with(['participante', 'sorteo.premio']) ->whereHas('sorteo.premio', fn($q) => $q->where('evento_id', $evento->id)) ->where('estado', 'ganador') ->latest() ->limit(10) ->get(); @endphp @if($ganadores->count() > 0)
Últimos ganadores Exportar CSV
@foreach($ganadores as $g) @endforeach
ParticipanteDocumentoZonaPremioLugar
{{ $g->participante?->nombre ?? '—' }} {{ $g->participante?->documento ?? '—' }} {{ $g->participante?->zona ?? '—' }} {{ $g->sorteo?->premio?->emoji }} {{ $g->sorteo?->premio?->nombre ?? '—' }} {{ $g->lugar }}°
@endif @endsection