{{-- 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