@extends('frontend/layouts_frontend/master_frontend') @section('title') Apartment Details - Relocate Uganda @endsection @section('extra_styles') @endsection {{-- CONTENT SECTION --}} @section('content')

Apartments Details

We have the properties

@if (session('messagesave')) {{--
{{ session('message')}}
--}} @endif @if (session('messagenoapartments')) {{--
{{ session('message')}}
--}} @endif
@if ($apartment->units_available > 0)
PROPERTY AVAILABLE FOR BOOKING
@elseif($apartment->units_available <= 0)
You cannot book it. @else N/A @endif
@if (!empty($apartment->price)) PRICE : USD {{ $apartment->price }} @else PRICE : N/A @endif | @if (!empty($apartment->units_available >= 0)) UNITS LEFT : {{ $apartment->units_available }} @elseif($apartment->units_available == 0) 0 @else N/A @endif

@if (!empty($apartment->name)) {{ $apartment->name }} @else N/A @endif

  • @if (!empty($apartment->address)) Address : {{ $apartment->address }} @else Address : N/A @endif
  • @if (!empty($apartment->city)) City : {{ $apartment->city }} @else City : N/A @endif
  • @if (!empty($apartment->created_at)) Added on : {{ $apartment->created_at }} @else Added on : N/A @endif
  • @if (!empty($apartment->apartment_category->category_name)) Category : {{ $apartment->apartment_category->category_name }} @else Category : N/A @endif
{{-- left side bar --}}
{{-- featured photo --}} preview
{{-- end featured photo --}}

About This Apartment

@if (!empty($apartment->description)) {{ $apartment->description }} @else N/A @endif

{{-- photo library upload --}}
Apartment Photos Collection
{{-- pick multiple images from array --}} @if (!empty($apartment->photo_library)) @foreach (is_null($apartment->photo_library) ? [] : explode(',', $apartment->photo_library) as $image) {{-- START COL --}} {{-- END COL --}} @endforeach @else
No Photos Available
@endif {{-- end pick multiple images from array --}}
{{-- end of photo library upload --}} {{-- overview --}}

Overview of the apartment

{{-- amenities --}}

Amenities

@forelse ($apartment->amenities as $amenity)
  • {{ $amenity->name }}
@empty No Amenities Available @endforelse

{{-- end of amenities --}} {{-- FETCH PROXIMITY INFORMATION --}}

Proximities to nearby areas

@php // pick proximities in each category $apartment_proximities_data = !empty($apartment->apartment_proximities) ? json_decode($apartment->apartment_proximities, true): []; // pick data $restaurants_nearyby = collect($apartment_proximities_data)->where('place_category','restaurant'); $shopping_malls_nearby = collect($apartment_proximities_data)->where('place_category','shopping_mall'); $police_station_nearby = collect($apartment_proximities_data)->where('place_category','police_station'); $schools_nearby = collect($apartment_proximities_data)->where('place_category','school'); $hospitals_nearby = collect($apartment_proximities_data)->where('place_category','hospital'); $sports_grounds_nearby = collect($apartment_proximities_data)->where('place_category','sports_ground'); $christian_worship_places_nearby = collect($apartment_proximities_data)->where('place_category','christian_worship_place'); $moslem_worship_places_nearby = collect($apartment_proximities_data)->where('place_category','moslem_worship_place'); @endphp {{-- fetch nearby restaurants --}} @if (count($restaurants_nearyby) > 0)
    @foreach ($restaurants_nearyby as $key => $restaurant)
  • Name : {{ $restaurant['place_name'] }} | Distance : | {{ $restaurant['place_distance'] }} Time : {{ $restaurant['place_time'] }} | Address : {{ $restaurant['place_address'] }}
  • @endforeach
@else
No Restaurants Nearby
@endif {{-- end of fetch nearby restaurants --}} {{-- fetch nearby shopping malls --}} @if (count($shopping_malls_nearby) > 0)
    @foreach ($shopping_malls_nearby as $key => $shopping_mall) {{-- {{ dd($shopping_mall) }} --}}
  • Name : {{ $shopping_mall['place_name'] }} | Distance : | {{ $shopping_mall['place_distance'] }} Time : {{ $shopping_mall['place_time'] }} | Address : {{ $shopping_mall['place_address'] }}
  • @endforeach
@else
No Shopping Malls Nearby
@endif {{-- end of fetch nearby shopping malls --}} {{-- fetch police stations --}} @if (count($police_station_nearby) > 0)
    @foreach ($police_station_nearby as $key => $police_station)
  • Name : {{ $police_station['place_name'] }} | Distance : | {{ $police_station['place_distance'] }} Time : {{ $police_station['place_time'] }} | Address : {{ $police_station['place_address'] }}
  • @endforeach
@else
No Police Stations Nearby
@endif {{-- end of fetch police stations --}} {{-- fetch schools nearby --}} @if (count($schools_nearby) > 0)
    @foreach ($schools_nearby as $key => $schools)
  • Name : {{ $schools['place_name'] }} | Distance : | {{ $schools['place_distance'] }} Time : {{ $schools['place_time'] }} | Address : {{ $schools['place_address'] }}
  • @endforeach
@else
No Schools Nearby
@endif {{-- end of fetch schools nearby --}} {{-- fetch Hospitals Nearby --}} @if (count($hospitals_nearby) > 0)
    @foreach ($hospitals_nearby as $key => $hospital)
  • Name : {{ $hospital['place_name'] }} | Distance : | {{ $hospital['place_distance'] }} Time : {{ $hospital['place_time'] }} | Address : {{ $hospital['place_address'] }}
  • @endforeach
@else
No Hospitals Nearby
@endif {{-- end of fetch schools nearby --}} {{-- fetch Sports grounds Nearby --}} @if (count($sports_grounds_nearby) > 0)
    @foreach ($sports_grounds_nearby as $key => $sports_ground)
  • Name : {{ $sports_ground['place_name'] }} | Distance : | {{ $sports_ground['place_distance'] }} Time : {{ $sports_ground['place_time'] }} | Address : {{ $sports_ground['place_address'] }}
  • @endforeach
@else
No Sports grounds Nearby
@endif {{-- end of fetch sports ground nearby --}} {{-- fetch Christian Worship Places Nearby --}} @if (auth()->user()->religion === 'christian') @if (count($christian_worship_places_nearby) > 0)
    @foreach ($christian_worship_places_nearby as $key => $christian_worship_place)
  • Name : {{ $christian_worship_place['place_name'] }} | Distance : | {{ $christian_worship_place['place_distance'] }} Time : {{ $christian_worship_place['place_time'] }} | Address : {{ $christian_worship_place['place_address'] }}
  • @endforeach
@else
No Christian Worship Places Nearby
@endif {{-- end of fetch christian worship places nearby --}} @endif {{-- fetch Moslem worship Places Nearby --}} @if (auth()->user()->religion === 'moslem') @if (count($moslem_worship_places_nearby) > 0)
    @foreach ($moslem_worship_places_nearby as $key => $moslem_worship_place)
  • Name : {{ $moslem_worship_place['place_name'] }} | Distance : | {{ $moslem_worship_place['place_distance'] }} Time : {{ $moslem_worship_place['place_time'] }} | Address : {{ $moslem_worship_place['place_address'] }}
  • @endforeach
@else
No Moslem worship Places Nearby
@endif @endif {{-- end of fetch moslem worship places nearby --}}
{{-- END OF FETCH PROXIMITY INFORMATION --}}
{{-- end left side bar --}} {{-- side bar right --}}
{{-- end side bar right --}}
@endsection