@extends($activeTemplate . 'layouts.frontend') @php // Helper function to create URL-friendly slugs function str_slug($string) { $string = strtolower($string); $string = str_replace(' ', '-', $string); $string = preg_replace('/[^a-z0-9\-]/', '', $string); return $string; } // Helper function to safely handle locations input function getLocationsArray($locations) { if (is_array($locations)) { return $locations; } else { return $locations ? explode(',', $locations) : []; } } // Helper function to format locations for display function formatLocationsDisplay($locations) { $locationArray = getLocationsArray($locations); if (empty($locationArray)) { return 'Where are you going?'; } return implode(', ', array_map(function($loc) { return ucfirst(str_replace('-', ' ', $loc)); }, $locationArray)); } // Hotel data definition - 2 Static Hotels with Colombo and Malabe $hotels = [ [ 'name' => 'City stay', 'price' => 150, 'rating' => 4.5, 'image' => asset('assets/images/destinations/WhatsApp Image 2026-03-30 at 16.24.12.jpeg'), 'description' => 'Perfect city stay in the heart of Colombo with modern amenities and easy access to attractions.', 'amenities' => ['Pool', 'Spa', 'Restaurant', 'Free WiFi'], 'destination' => 'colombo', 'type' => 'luxury', 'gallery' => [ asset('assets/images/destinations/WhatsApp Image 2026-03-30 at 16.24.12.jpeg') ] ], [ 'name' => 'Fun place to stay', 'price' => 110, 'rating' => 4.6, 'image' => asset('assets/images/destinations/hotel12.jpeg'), 'description' => 'A fun place to stay in Malabe with entertainment facilities and relaxing atmosphere.', 'amenities' => ['Pool', 'Gaming', 'Restaurant', 'Garden'], 'destination' => 'malabe', 'type' => 'resort', 'gallery' => [ asset('assets/images/destinations/hotel1.jpeg'), asset('assets/images/destinations/hotel3.jpeg'), asset('assets/images/destinations/hotel4.jpeg'), asset('assets/images/destinations/hotel5.jpeg'), asset('assets/images/destinations/hotel6.jpeg'), asset('assets/images/destinations/hotel7.jpeg'), asset('assets/images/destinations/hotel8.jpeg'), asset('assets/images/destinations/hotel9.jpeg'), asset('assets/images/destinations/hote;10.jpeg'), asset('assets/images/destinations/hotel13.jpeg') ] ] ]; // Get locations array for use in the template $locationsArray = getLocationsArray(request()->get('locations', '')); // Filter hotels based on selected location $selectedLocation = request()->get('location', ''); $filteredHotels = []; if ($selectedLocation === 'colombo') { $filteredHotels = array_filter($hotels, function($hotel) { return $hotel['destination'] === 'colombo'; }); } elseif ($selectedLocation === 'malabe') { $filteredHotels = array_filter($hotels, function($hotel) { return $hotel['destination'] === 'malabe'; }); } // Re-index array after filtering $filteredHotels = array_values($filteredHotels); @endphp @section('content')

{{ empty($selectedLocation) ? '0' : count($filteredHotels) }} properties found

{{ empty($selectedLocation) ? 'Select a location to view hotels' : (request()->get('location') == 'colombo' ? 'City stay experience' : 'Fun place to stay') }}

Sort by: Recommended ▼
Map view
List view
@if(empty($selectedLocation))
📍

Select Your Location

Please select a location from the dropdown above to view available hotels.

Choose from Colombo (City stay) or Malabe (Fun place to stay) to see our premium hotel selections.

@elseif(count($filteredHotels) > 0) @foreach($filteredHotels as $index => $hotel)
{{ $hotel['name'] }}
{{ $hotel['rating'] }}
Free cancellation

{{ $hotel['name'] }}

{{ $hotel['description'] }}

@foreach(array_slice($hotel['amenities'], 0, 4) as $amenity) {{ $amenity }} @endforeach
{{ $hotel['rating'] }} Superb
{{ rand(100, 500) }} reviews
📍 Location: Excellent - {{ rand(1, 3) }}.{{ rand(0, 9) }} km from center
FREE CANCELLATION
No prepayment needed
Contact for pricing
@endforeach @else

No hotels found

Please try adjusting your search criteria

@endif
@endsection @push('script') @endpush @push('style') @endpush