@if(isset($photos) && $photos->count() > 0)
@endif
{{-- PANNEAU VIDÉOS --}}
@foreach($photos as $album)
@php
$galleryId = 'album-' . $album->id;
$coverRaw = $album->image_path ?? '';
$coverUrl = str_starts_with($coverRaw, 'http')
? $coverRaw
: asset('storage/' . ltrim(str_replace('storage/', '', $coverRaw), '/'));
$imagesEnfants = $album->fichiers
? $album->fichiers->where('chemin', '!=', '#')->where('chemin', '!=', $coverUrl)
: collect();
$totalPhotos = $imagesEnfants->count() + 1;
@endphp
@endforeach
@else
{{ $totalPhotos }}
@if($imagesEnfants->count() > 0)
@foreach($imagesEnfants as $fichierRestant)
@endforeach
@endif
{{ $album->created_at ? $album->created_at->translatedFormat('d M Y') : 'Date non définie' }}
{{ Str::limit($album->titre, 40) }}
@if(!empty($album->evenement)){{ Str::limit($album->evenement, 50) }}
@endif
Aucun album disponible
Les collections photographiques apparaîtront ici prochainement.
@if(isset($videos) && $videos->count() > 0)
@endif
@foreach($videos as $video)
@php
$coverRaw = $video->image_url ?? '';
$coverVideoUrl = str_starts_with($coverRaw, 'http')
? $coverRaw
: asset('storage/' . ltrim(str_replace('storage/', '', $coverRaw), '/'));
$firstFile = $video->fichiers?->first();
$videoSrc = $firstFile ? $firstFile->chemin : '#';
@endphp
@endforeach
@else
Aucune vidéo disponible
Les productions vidéos apparaîtront ici prochainement.