📰 Eventos recientes

@php $posts2 = [ (object)[ 'id' => 1, 'title' => 'Festival Cultural 2025', 'content' => 'Disfruta del festival con música, arte y gastronomía local. ¡Todos están invitados!', 'images' => [ 'https://i0.wp.com/cruce.iteso.mx/wp-content/uploads/2023/10/PORTADA-FESTIVAL-CULTURAL.jpg?resize=1024%2C640&ssl=1?fit=crop&w=600&h=400', 'https://images.unsplash.com/photo-1492684223066-81342ee5ff30?fit=crop&w=600&h=400', 'https://images.unsplash.com/photo-1492684223066-81342ee5ff30?fit=crop&w=600&h=400', 'https://images.unsplash.com/photo-1492684223066-81342ee5ff30?fit=crop&w=600&h=400', 'https://images.unsplash.com/photo-1506744038136-46273834b3fb?fit=crop&w=600&h=400', ], 'published_at' => now()->subHours(6), 'user' => (object)['name' => 'Gabriel Cruz'], 'categorias' => [(object)['nombre' => 'Cultura'], (object)['nombre' => 'Eventos']], 'comments' => [ (object)[ 'body' => '¡Nos vemos allá!', 'user' => (object)['name' => 'Ana Torres'], 'created_at' => now()->subHours(2), ], (object)[ 'body' => '¿Dónde será exactamente?', 'user' => (object)['name' => 'Luis Martínez'], 'created_at' => now()->subHour(), ], ], 'likes_count' => 31 ], (object)[ 'id' => 2, 'title' => 'Concierto de Jazz al Aire Libre', 'content' => 'Una noche mágica con lo mejor del jazz local. Entrada libre.', 'images' => [ 'https://via.placeholder.com/600x400?text=Jazz+1', 'https://via.placeholder.com/600x400?text=Jazz+2', ], 'published_at' => now()->subDays(1), 'user' => (object)['name' => 'María López'], 'categorias' => [], 'comments' => [], 'likes_count' => 12 ] ]; @endphp @foreach ($posts2 as $post)
{{-- Encabezado --}}
{{ $post->title }}
Publicado por {{ $post->user->name }} • {{ $post->published_at->diffForHumans() }}
@forelse ($post->categorias as $cat) {{ $cat->nombre }} @empty Sin categoría @endforelse
{{-- Contenido --}}

{{ $post->content }}

{{-- Grid de imágenes estilo Facebook --}} @php $images = $post->images; $total = count($images); @endphp {{-- Reacciones --}}
👍 {{ $post->likes_count }} Me gusta 💬 {{ count($post->comments) }} Comentarios
{{-- Comentarios --}}
@forelse ($post->comments as $comment)
{{ $comment->user->name }}: {{ $comment->body }}
{{ $comment->created_at->diffForHumans() }}
@empty
Sé el primero en comentar.
@endforelse
{{-- Caja de nuevo comentario --}}
@endforeach {{--
{{ $posts->links() }}
--}}
Show