@php use App\Support\Company; use App\Support\IndiaMap; use App\Support\MediaUrl; $officesList = collect($offices)->values(); $hq = $officesList->first(fn ($o) => ! empty($o['is_hq'])) ?? $officesList->first(fn ($o) => strcasecmp((string) ($o['city'] ?? ''), 'Jamshedpur') === 0); $hqPoint = $hq['map'] ?? IndiaMap::pointForCity('Jamshedpur'); $mapOffices = $officesList->map(function (array $office, int $i) { $phone = trim((string) ($office['phone'] ?? '')); $email = trim((string) ($office['email'] ?? '')); $pt = $office['map'] ?? null; return [ 'i' => $i, 'city' => $office['city'] ?? '', 'role' => $office['role'] ?? '', 'address' => $office['address'] ?? '', 'phone' => $phone !== '' ? $phone : null, 'email' => $email !== '' ? $email : null, 'phoneHref' => $phone !== '' ? 'tel:'.preg_replace('/[^\d+]/', '', $phone) : null, 'image' => MediaUrl::url($office['image'] ?? null, 'images/graphics/about-operations.png'), 'is_hq' => ! empty($office['is_hq']), 'x' => $pt['x'] ?? null, 'y' => $pt['y'] ?? null, ]; })->values(); @endphp @extends('layouts.app') @section('title', $page['title'] ?? 'Our Locations') @section('meta_description', Company::NAME.' locations — Head Office Jamshedpur and regional offices across India.') @section('content')
{{-- Location cards --}}
@foreach ($officesList as $i => $office) @php $phone = trim((string) ($office['phone'] ?? '')); $email = trim((string) ($office['email'] ?? '')); $phoneHref = $phone !== '' ? 'tel:'.preg_replace('/[^\d+]/', '', $phone) : null; $isHq = ! empty($office['is_hq']); @endphp
$isHq, 'bg-xpert-red/10 text-xpert-red' => ! $isHq, ])>

{{ $office['city'] }}

@if ($isHq) HQ @endif

{{ $office['role'] }}

@if (! empty($office['address']))

{{ $office['address'] }}

@endif @if ($phone !== '' || $email !== '')
@if ($phone !== '') {{ $phone }} @endif @if ($email !== '') {{ $email }} @endif
@endif
@endforeach
{{-- India map --}}

Network map

Hover a pin for office details

@if ($hqPoint) @foreach ($officesList as $i => $office) @continue(! empty($office['is_hq']) || empty($office['map'])) @php $pt = $office['map']; @endphp @endforeach @endif @foreach ($officesList as $i => $office) @continue(empty($office['map'])) @php $pt = $office['map']; $isHq = ! empty($office['is_hq']); $labelEnd = $pt['x'] > IndiaMap::VIEW_W * 0.72; @endphp {{-- Larger hit area --}} @if ($isHq) @else @endif {{ $office['city'] }} @endforeach {{-- Hover detail card --}}

@include('partials.page-cta') @endsection