--- title: "contact-15" description: "Centred locations section: two office cards, each with a photo, city, address and a directions link." category: "Contact" --- # contact-15 Centred locations section: two office cards, each with a photo, city, address and a directions link. ## Installation ```bash php artisan ui:add-block contact-15 ``` ## Dependencies - composer: `gehrisandro/tailwind-merge-laravel` - component: [button](https://laralcn-ui.abdulkadersafi.com/ar/components/button.md) — the CLI installs it for you. ## Source `resources/views/components/ui/blocks/contact-15.blade.php` ```blade {{-- Centred locations section: one card per office with a photo, city, address and a directions link. Every piece of content is a prop. A location is ['name' => ..., 'address' => ...] plus optional 'href' (the directions link, which defaults to a Google Maps search for the address) and 'image' => ['src' => ..., 'alt' => ...]. Without an image src the card shows a placeholder. --}} @props([ 'tagline' => 'Tagline', 'heading' => 'Locations', 'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'locations' => [ ['name' => 'Sydney', 'address' => '123 Sample St, Sydney NSW 2000 AU'], ['name' => 'New York', 'address' => '123 Sample St, New York NY 10000 USA'], ], 'directionsLabel' => 'Get Directions', ])
merge(['class' => 'w-full bg-background px-[5%] py-16 text-foreground md:py-24 lg:py-28']) }}>
@if ($tagline)

{{ $tagline }}

@endif

{{ $heading }}

@if ($description)

{{ $description }}

@endif
@foreach ($locations as $location) @php $image = $location['image'] ?? []; $address = $location['address'] ?? ''; $href = $location['href'] ?? 'https://www.google.com/maps/search/?api=1&query=' . urlencode($address); @endphp
@if (!empty($image['src'])) {{ $image['alt'] ?? '' }} @else
@endif

{{ $location['name'] ?? '' }}

{{ $address }}
@if ($directionsLabel) {{ $directionsLabel }} @endif
@endforeach
```