@php $code = request()->query('id'); @endphp @if($code) @php $gallery = \App\Models\Backend\ContentPhotoGallery::with('translations') ->where('gallery_code', $code) ->where('gallery_status', 'ACTIVE') ->first(); @endphp @if($gallery) @php $gt = $gallery->translations->firstWhere('gallery_translation_language', $lang) ?? $gallery->translations->first(); $photos = \App\Models\Backend\ContentPhotoList::where('photo_gallery_id', $gallery->gallery_id) ->where(function ($q) { $q->whereNull('photo_main')->orWhere('photo_main', '1'); }) ->orderBy('photo_sort') ->orderBy('photo_id') ->get(); $photoTrans = \App\Models\Backend\ContentPhotoList::where('photo_gallery_id', $gallery->gallery_id) ->where('photo_language', $lang) ->whereNotNull('photo_parent_id') ->pluck('photo_descr', 'photo_parent_id'); @endphp Utama / Galeri / {{ $gt?->gallery_translation_title ?? $gallery->gallery_code }} {{ $gt?->gallery_translation_title ?? 'Galeri' }} @if($gt?->gallery_translation_descr) {{ $gt->gallery_translation_descr }} @endif {{ $photos->count() }} gambar @if($photos->count()) @foreach($photos as $p) @php $cap = $photoTrans[$p->photo_id] ?? $p->photo_descr; @endphp @if($cap){{ $cap }}@endif @endforeach @else Tiada gambar dalam galeri ini. @endif Kembali ke Galeri @else Galeri tidak ditemui Maaf, galeri yang anda cari tidak wujud atau telah dialihkan. Kembali ke Galeri @endif @else @php $items = \App\Models\Backend\ContentPhotoGallery::with(['translations' => function($q) use ($lang) { $q->where('gallery_translation_language', $lang); }])->where('gallery_status', 'ACTIVE')->orderBy('gallery_date', 'desc')->get(); @endphp @if($items->count()) Galeri Galeri Foto Koleksi gambar dan foto-foto rasmi. @foreach($items as $item) @php $t = $item->translations->first(); @endphp @if($item->gallery_thumbnail) @else @endif {{ $t->gallery_translation_title ?? 'Galeri' }} @if($t->gallery_translation_descr){{ Str::limit($t->gallery_translation_descr, 100) }}@endif @endforeach @else Tiada GaleriTiada galeri foto buat masa ini. Kembali @endif @endif
{{ $gt->gallery_translation_descr }}
{{ $photos->count() }} gambar
Tiada gambar dalam galeri ini.
Maaf, galeri yang anda cari tidak wujud atau telah dialihkan.
Koleksi gambar dan foto-foto rasmi.
{{ Str::limit($t->gallery_translation_descr, 100) }}
Tiada galeri foto buat masa ini.