@extends('themes.one.master') @php $pageInfo = []; $pageTitle = ''; foreach($pageSettings as $page){ if($page['page'] == $currentPageSlug){ $pageInfo = $page; $pageTitle = transField($pageInfo, 'title') ?? __('Gallery'); } } @endphp @section('title', $pageTitle) @section('content') @if(!empty($banner))

{{ transField($banner, 'title') }}

@else

{{ __('Gallery') }}

@endif

{{ __('Our Gallery') }}

@php $items = $galleries instanceof \Illuminate\Support\Collection ? $galleries : collect($galleries); $parseGroups = function ($raw) { if (!$raw) return []; if (is_array($raw)) return array_values(array_filter(array_map('trim', $raw))); $parts = preg_split('/[,|;]+/', (string) $raw); return array_values(array_filter(array_map(fn($s) => \Illuminate\Support\Str::slug(trim($s)), $parts))); }; $allGroups = $items ->flatMap(fn ($it) => $parseGroups($it['groups'] ?? null)) ->unique() ->values(); $pretty = fn($slug) => \Illuminate\Support\Str::of($slug)->replace('-', ' ')->title(); $sorted = $items->sortBy(function($it) { $order = $it['sort_order'] ?? null; return is_numeric($order) ? (int)$order : PHP_INT_MAX; }); @endphp
@foreach($allGroups as $g) @php $group = $pretty($g)->value(); @endphp @endforeach
@include('themes.one.sections.subscribe') @endsection