@extends('layouts.app') @section('title', 'Eventos Disponibles') @section('content')

Eventos Disponibles para Participar

@if($eventos->count() > 0)
@foreach($eventos as $evento)
{{ $evento->nombre }}
{{ format_date_es($evento->fecha_evento) }}
{{ format_time_range_12h($evento->hora_inicio, $evento->hora_fin) }}
@if($evento->cancha)
{{ $evento->cancha->nombre }}
@endif

{{ Str::limit($evento->descripcion, 100) }}

{{ $evento->participantes->count() }}/{{ $evento->max_participantes }} participantes
@if($evento->precio > 0)
${{ number_format($evento->precio, 0, ',', '.') }}
@else
Gratis
@endif
@php $yaParticipa = $evento->participantes->contains('id', auth()->id()); $eventoLleno = $evento->participantes->count() >= $evento->max_participantes; $fechaPasada = \Carbon\Carbon::parse($evento->fecha_evento)->isPast(); @endphp
Ver Detalles @if($yaParticipa) @elseif($fechaPasada) @elseif($eventoLleno) @else @endif
@endforeach
{{ $eventos->links() }}
@else

No hay eventos disponibles

En este momento no hay eventos disponibles para participar.

@endif
@endsection