{{-- resources/views/page/agency/themes/default/sections/tour_search.blade.php --}} @php // Get agency's active product types (only tour related) $tourProductTypes = $agency->productTypes() ->where('agency_product_types.is_active', true) ->whereIn('code', ['kultur-turu', 'gunubirlik-tur']) ->orderBy('sort_order') ->get(); // Get unique departure cities from tours $departureCityIds = collect(); if ($tourProductTypes->contains('code', 'kultur-turu')) { $kulturTuruCityIds = \App\Models\Tour\Tour::where('agency_id', $agency->id) ->active() ->public() ->whereNotNull('departure_city_id') ->distinct() ->pluck('departure_city_id'); $departureCityIds = $departureCityIds->merge($kulturTuruCityIds); } if ($tourProductTypes->contains('code', 'gunubirlik-tur')) { $gunubirlikCityIds = \App\Models\DayTour\DayTour::where('agency_id', $agency->id) ->where('is_active', true) ->whereNotNull('departure_city_id') ->distinct() ->pluck('departure_city_id'); $departureCityIds = $departureCityIds->merge($gunubirlikCityIds); } $departureCityIds = $departureCityIds->unique()->filter()->values(); // Get city names $departureCities = \App\Models\Definition\City::whereIn('id', $departureCityIds) ->orderBy('city') ->get(); $sectionStyle = $section->getConfig('style', 'default'); $showBackground = $section->getConfig('show_background', true); $backgroundImage = $section->getData('background_image'); @endphp @if($showBackground && $backgroundImage) @endif @if($section->title || $section->subtitle) @if($section->subtitle) {{ $section->subtitle }} @endif @if($section->title) {{ $section->title }} @endif @endif {{-- Product Type Selection --}} @if($tourProductTypes->count() > 1) Tur Tipi @foreach($tourProductTypes as $index => $productType) @if($productType->icon) @endif {{ $productType->name }} @endforeach @elseif($tourProductTypes->count() === 1) @endif {{-- Search Fields --}} {{-- Departure Point --}} Kalkış Noktası Tum Şehirler @foreach($departureCities as $city) {{ $city->name }} @endforeach {{-- Destination / Keyword --}} Nereye / Anahtar Kelime {{-- Date --}} Tarih {{-- Search Button --}} Tur Ara {{-- Quick Links --}} @if($section->getConfig('show_quick_links', true) && $departureCities->count() > 0) Populer Kalkis Noktalari: @foreach($departureCities->take(5) as $city) {{ $city->name }} @endforeach @endif
{{ $section->subtitle }}