{{ $district['projects'] ?? '' }}
{{ $district['name'] ?? '' }}
{{ $district['description'] ?? '' }}
@extends('web.layouts.web-master') @php $ui = data_get($content, 'ui', []); $modalUi = data_get($ui, 'modal', []); $lightboxUi = data_get($ui, 'lightbox', []); $dev = $dev ?? false; $devQuery = $devQuery ?? false; $overviewRouteName = $overviewRouteName ?? ($dev ? 'dev.immobilien-azizi' : 'immobilien'); $detailRouteName = $detailRouteName ?? ($dev ? 'dev.immobilien-azizi.show' : 'immobilien.show'); $detailUrl = fn(string $slug): string => route( $detailRouteName, $devQuery ? ['slug' => $slug, 'dev' => 1] : ['slug' => $slug], ); $projects = collect($content['projects'] ?? []); $featured = $content['featured'] ?? []; $featuredProject = $projects->firstWhere('slug', $featured['slug'] ?? ''); $categories = collect($content['categories'] ?? []); $districts = collect(data_get($content, 'districts.items', [])); $featuredSlug = data_get($featured, 'slug'); $gridProjects = $projects->reject(fn($project) => $project['slug'] === $featuredSlug); $gridProjectsCount = $gridProjects->count(); $anchorId = fn(string $prefix, string $value): string => $prefix . '-' . \Illuminate\Support\Str::slug($value); $categoryNavItems = $categories ->map(function (array $category) use ($gridProjects, $anchorId): array { $categoryProjects = $gridProjects->where('category', $category['key']); return [ 'id' => $anchorId('category', $category['key']), 'title' => $category['title'], 'count' => $categoryProjects->count(), ]; }) ->filter(fn(array $item): bool => $item['count'] > 0) ->values(); $districtAliases = [ 'Dubai South' => ['Dubai South', 'Azizi Venice'], 'Dubailand / Azizi Milan' => ['Dubailand', 'Dubai Land', 'Azizi Milan'], 'Dubai Healthcare City / Al Jaddaf' => ['Dubai Healthcare City', 'Healthcare City', 'Al Jaddaf', 'DHCC'], 'Dubai Studio City' => ['Dubai Studio City', 'Studio City'], 'Meydan' => ['Meydan', 'MBR City', 'Riviera'], 'Palm Jumeirah' => ['Palm Jumeirah'], 'Al Furjan' => ['Al Furjan'], 'Dubai Islands' => ['Dubai Islands'], 'Jebel Ali' => ['Jebel Ali'], 'Jumeirah Village Circle' => ['Jumeirah Village Circle', 'JVC'], ]; $districtProjectGroups = $districts ->map(function (array $district) use ($gridProjects, $districtAliases, $anchorId): array { $name = $district['name'] ?? ''; $aliases = $districtAliases[$name] ?? [$name]; $districtProjects = $gridProjects ->filter(function (array $project) use ($aliases): bool { $location = $project['location'] ?? ''; foreach ($aliases as $alias) { if (str_contains(strtolower($location), strtolower($alias))) { return true; } } return false; }) ->values(); return [ 'id' => $anchorId('district', $name), 'name' => $name, 'description' => $district['description'] ?? '', 'projects_label' => $district['projects'] ?? '', 'projects' => $districtProjects, 'count' => $districtProjects->count(), ]; }) ->filter(fn(array $group): bool => $group['count'] > 0) ->values(); $statusLabels = data_get($ui, 'status_labels', []); $statusClasses = [ 'ready' => 'bg-emerald-500', 'construction' => 'bg-sky-500', 'offplan' => 'bg-amber-400 text-zinc-950', ]; $projectUnitType = fn(array $project): string => $project['official_unit_type'] ?? ($project['overview_bedrooms'] ?? ($project['units'] ?? data_get($ui, 'fallbacks.unit_type', 'Einheitentypen prüfen'))); $parseAedPrice = function (?string $value): ?int { if (!is_string($value) || !preg_match('/AED\s*([0-9][0-9.,]*)\s*([KkMm])?/u', $value, $matches)) { return null; } $number = $matches[1]; $suffix = strtolower($matches[2] ?? ''); if ($suffix === 'm') { return (int) round((float) str_replace(',', '.', $number) * 1_000_000); } if ($suffix === 'k') { return (int) round((float) str_replace(',', '.', $number) * 1_000); } return (int) preg_replace('/\D+/', '', $number); }; $priceFallback = data_get($ui, 'show_page.stat_price_fallback', 'Auf Anfrage'); $formatProjectPrice = function (array $project) use ($parseAedPrice, $priceFallback): string { $price = $project['official_starting_price'] ?? ($project['price_from'] ?? null); $aed = $parseAedPrice($price); if ($aed === null || $aed <= 0) { return $project['price_from'] ?? $priceFallback; } return \App\Helpers\PriceHelper::formatAed($aed, 'ab'); }; $projectImages = function (array $project): array { $slug = $project['slug'] ?? ''; $fallbackImage = theme_image_url($project['image'] ?? 'b2in/hero-immobilien.jpg'); $basePath = storage_path('app/public/immobile/dubai/' . $slug); $paths = collect([ glob($basePath . '/image/*.{webp,jpg,jpeg,png}', GLOB_BRACE) ?: [], glob($basePath . '/official-website/*.{webp,jpg,jpeg,png}', GLOB_BRACE) ?: [], ]) ->flatten() ->all(); sort($paths, SORT_NATURAL); $urls = collect($paths) ->map(fn(string $path): string => theme_image_url(str_replace(storage_path('app/public') . '/', '', $path))) ->values(); return [ 'hero' => $urls->first() ?? $fallbackImage, 'gallery' => $urls->take(6)->values()->all(), ]; }; $modalProjects = $projects->mapWithKeys(function (array $project) use ( $formatProjectPrice, $detailUrl, $projectImages, $projectUnitType, $statusClasses, ): array { $images = $projectImages($project); return [ $project['slug'] => [ 'slug' => $project['slug'], 'title' => $project['title'] ?? '', 'location' => $project['location'] ?? '', 'status' => $project['status'] ?? '', 'status_class' => $statusClasses[$project['status_group'] ?? 'ready'] ?? 'bg-secondary', 'price_from' => $formatProjectPrice($project), 'handover' => $project['handover'] ?? data_get($ui, 'fallbacks.handover'), 'units' => $projectUnitType($project), 'image_url' => $images['hero'], 'gallery_images' => $images['gallery'], 'short' => $project['short'] ?? '', 'marcel_take' => $project['marcel_take'] ?? '', 'official_description_de' => $project['official_description_de'] ?? '', 'buyer_profile' => $project['buyer_profile'] ?? '', 'highlights' => $project['highlights'] ?? [], 'official_url' => $project['official_url'] ?? '', 'detail_url' => $detailUrl($project['slug']), ], ]; }); @endphp @section('title', data_get($content, 'meta.title', 'Dubai Immobilien - B2in')) @section('meta_description', data_get($content, 'meta.description', 'Kuratierte Immobilienprojekte in Dubai.')) @section('content')
{{ data_get($content, 'hero.eyebrow') }}
{{ data_get($content, 'hero.subtitle') }}
{{ data_get($content, 'hero.microcopy') }}
{{ data_get($ui, 'intro_eyebrow') }}
"{{ data_get($content, 'intro.quote') }}"
{{ $paragraph }}
@endforeach{{ $featured['location'] ?? '' }}
{{ $featured['status'] ?? '' }}
{{ $featured['text'] ?? '' }}
{{ data_get($ui, 'featured_marcel_heading') }}
{{ $featured['marcel_take'] ?? '' }}
{{ data_get($content, 'map.subtitle') }}
{{ $projects->where('status_group', $key)->count() }} Projekte in dieser Auswahl.
{{ data_get($ui, 'districts_eyebrow') }}
{{ data_get($content, 'districts.subtitle') }}
{{ $district['projects'] ?? '' }}
{{ $district['description'] ?? '' }}
{{ data_get($ui, 'grid_eyebrow') }}
{{ data_get($ui, 'grid_intro') }}
{{ str_replace([':categories', ':districts'], [$categoryNavItems->count(), $districtProjectGroups->count()], data_get($ui, 'filter_summary', '')) }}
{{ $category['intro'] }}
{{ $project['location'] }}
{{ $project['short'] }}
{{ $group['projects_label'] }}
{{ $group['description'] }}
{{ $project['location'] }}
{{ $project['short'] }}
{{ data_get($content, 'market_context.subtitle') }}
{{ $fact['description'] }}
{{ $step['description'] }}
{{ data_get($ui, 'mindset_positive_pill') }}
{{ data_get($content, 'mindset.positive') }}
{{ data_get($ui, 'mindset_negative_pill') }}
{{ data_get($content, 'mindset.negative') }}
{{ data_get($content, 'furniture.text') }}
{{ data_get($modalUi, 'header') }}
{{ data_get($modalUi, 'stat_price') }}
{{ data_get($modalUi, 'stat_handover') }}
{{ data_get($modalUi, 'stat_units') }}
{{ data_get($modalUi, 'section_investment') }}
{{ data_get($modalUi, 'official_description_label') }}
{{ data_get($modalUi, 'request_eyebrow') }}
{{ data_get($modalUi, 'request_text') }}