@foreach ($Totalhotels->sortByDesc('created_at')->take(8) as $hotelList)
@php
$images = json_decode($hotelList->image) ?? [];
$image = isset($images[0]) ? $images[0] : null;
$countryName = App\Models\Country::where('id', $hotelList->country)->first();
$cityName = App\Models\City::where('id', $hotelList->city)->first();
$claimStatus = App\Models\ClaimedListing::where('listing_id', $hotelList->id)->where('listing_type', 'hotel')->first();
@endphp
@php
$is_in_wishlist = check_wishlist_status($hotelList->id, $hotelList->type);
@endphp
{{ $hotelList->is_popular }}
@if(isset($claimStatus) && $claimStatus->status == 1)
@endif
{{ $hotelList->title }}
{{ $cityName->name }}, {{ $countryName->name }}
@php
$reviews_count = App\Models\Review::where('listing_id', $hotelList->id)->where('user_id', '!=', $hotelList->user_id)->where('type', 'hotel')->where('reply_id', null)->count();
$total_ratings = App\Models\Review::where('listing_id', $hotelList->id)->where('user_id', '!=', $hotelList->user_id)->where('type', 'hotel')->where('reply_id', null)->sum('rating');
$average_rating = $reviews_count > 0 ? $total_ratings / $reviews_count : 0;
@endphp
({{ $reviews_count }})
@php
if (isset($hotelList->feature) && is_array(json_decode($hotelList->feature))) {
$features = json_decode($hotelList->feature);
foreach ($features as $key => $item) {
$feature = App\Models\Amenities::where('id', $item)->first();
if ($key < 2) {
echo '- ' . $feature->name . '
';
}
}
$more_amenities = count(json_decode($hotelList->feature));
if ($more_amenities > 4) {
echo "- +" . ($more_amenities - 4) . ' ' . get_phrase('More') . '
';
}
}
@endphp
{{ get_phrase('See Details') }}
{{ currency($hotelList->price) }}
/{{ get_phrase('night') }}
@endforeach
@foreach ($Totalrestaurant->sortByDesc('created_at')->take(8) as $restaurantList)
@php
$resturentImage = json_decode($restaurantList->image) ?? [];
$image = isset($resturentImage[0]) ? $resturentImage[0] : null;
$countryNameR = App\Models\Country::where('id', $restaurantList->country)->first();
$cityNameR = App\Models\City::where('id', $restaurantList->city)->first();
$claimStatus = App\Models\ClaimedListing::where('listing_id', $restaurantList->id)->where('listing_type', 'restaurant')->first();
@endphp
@endforeach
@foreach ($Totalbeauty->sortByDesc('created_at')->take(8) as $beautyList)
@php
$beautyListImage = json_decode($beautyList->image) ?? [];
$image = isset($beautyListImage[0]) ? $beautyListImage[0] : null;
$countryNameB = App\Models\Country::where('id', $beautyList->country)->first();
$cityNameB = App\Models\City::where('id', $beautyList->city)->first();
$claimStatus = App\Models\ClaimedListing::where('listing_id', $beautyList->id)->where('listing_type', 'beauty')->first();
@endphp
{{ $beautyList->is_popular }}
@php
$is_in_wishlist = check_wishlist_status($beautyList->id, $beautyList->type);
@endphp
@php
$reviews_count = App\Models\Review::where('listing_id', $beautyList->id)->where('user_id', '!=', $beautyList->user_id)->where('type', 'beauty')->where('reply_id', null)->count();
$total_ratings = App\Models\Review::where('listing_id', $beautyList->id)->where('user_id', '!=', $beautyList->user_id)->where('type', 'beauty')->where('reply_id', null)->sum('rating');
$average_rating = $reviews_count > 0 ? $total_ratings / $reviews_count : 0;
@endphp
{{ number_format($average_rating, 1) }}
({{ $reviews_count }})
@if (open_status($beautyList->id, 'BeautyListing') === 'Open')
{{ get_phrase('Open') }}
@else
{{ get_phrase('Closed') }}
@endif
@endforeach
@foreach ($TotalrealEstate->sortByDesc('created_at')->take(8) as $realEsate)
@php
$realEsateImage = json_decode($realEsate->image) ?? [];
$image = isset($realEsateImage[0]) ? $realEsateImage[0] : null;
$countryNameReal = App\Models\Country::where('id', $realEsate->country)->first();
$cityNameReal = App\Models\City::where('id', $realEsate->city)->first();
$claimStatus = App\Models\ClaimedListing::where('listing_id', $realEsate->id)->where('listing_type', 'real-estate')->first();
@endphp
{{ $realEsate->status }}
@php
$is_in_wishlist = check_wishlist_status($realEsate->id, $realEsate->type);
@endphp
{{ $cityNameReal->name }}, {{ $countryNameReal->name }}
{{ $realEsate->bed }} {{ get_phrase('Bed') }}
{{ $realEsate->bath }} {{ get_phrase('Bath') }}
{{ $realEsate->size }} {{ get_phrase('sqft') }}
@if (!empty($realEsate->discount))
{{ currency($realEsate->discount) }}
{{ currency($realEsate->price) }}
@elseif(!empty($realEsate->price))
{{ currency($realEsate->price) }}
@endif
@endforeach
@foreach ($Totalcar->sortByDesc('created_at')->take(8) as $carList)
@php
$carImage = json_decode($carList->image) ?? [];
$image = isset($carImage[0]) ? $carImage[0] : null;
$countryNameCar = App\Models\Country::where('id', $carList->country)->first();
$cityNameCar = App\Models\City::where('id', $carList->city)->first();
$fuelType = App\Models\Amenities::where('id', $carList->fuel_type)->first();
$engineSize = App\Models\Amenities::where('id', $carList->engine_size)->first();
$claimStatus = App\Models\ClaimedListing::where('listing_id', $carList->id)->where('listing_type', 'car')->first();
@endphp
{{ $carList->is_popular }}
@php
$is_in_wishlist = check_wishlist_status($carList->id, $carList->type);
@endphp
-
{{ $engineSize->name }}
-
{{ $carList->mileage }}
-
{{ $fuelType->name }}
@if (!empty($carList->discount_price))
{{ currency($carList->discount_price) }}
{{ currency($carList->price) }}
@elseif(!empty($carList->price))
{{ currency($carList->price) }}
@endif
{{ get_phrase('View details') }}
@endforeach
@php
$staticTypes = ['car', 'hotel', 'real-estate', 'beauty', 'restaurant'];
$groupedListings = $customlistings->groupBy('type');
@endphp
@foreach($groupedListings as $type => $listingsByType)
@foreach($listingsByType->sortByDesc('created_at')->take(8) as $listing)
@php
$dynamicImage = json_decode($listing->image) ?? [];
$image = isset($dynamicImage[0]) ? $dynamicImage[0] : null;
$countryNamed = App\Models\Country::where('id', $listing->country)->first();
$cityNamed = App\Models\City::where('id', $listing->city)->first();
$claimStatus = App\Models\ClaimedListing::where('listing_id', $listing->id)->where('listing_type', $listing->type)->first();
@endphp
@php
$is_in_wishlist = check_wishlist_status($listing->id, $listing->type);
@endphp
{{ $listing->is_popular }}
@if(isset($claimStatus) && $claimStatus->status == 1)
@endif
{{ $listing->title }}
{{ $cityName->name }}, {{ $countryName->name }}
@php
$reviews_count = App\Models\Review::where('listing_id', $listing->id)->where('user_id', '!=', $listing->user_id)->where('type', $listing->type)->where('reply_id', null)->count();
$total_ratings = App\Models\Review::where('listing_id', $listing->id)->where('user_id', '!=', $listing->user_id)->where('type', $listing->type)->where('reply_id', null)->sum('rating');
$average_rating = $reviews_count > 0 ? $total_ratings / $reviews_count : 0;
@endphp
({{ $reviews_count }})
@php
if (isset($listing->feature) && is_array(json_decode($listing->feature))) {
$features = json_decode($listing->feature);
foreach ($features as $key => $item) {
$feature = App\Models\Amenities::where('id', $item)->first();
if ($key < 2) {
echo '- ' . $feature->name . '
';
}
}
$more_amenities = count(json_decode($listing->feature));
if ($more_amenities > 4) {
echo "- +" . ($more_amenities - 4) . ' ' . get_phrase('More') . '
';
}
}
@endphp
@endforeach
@if (!in_array($type, $staticTypes) && $listingsByType->count() > 7)
@endif
@endforeach
{{-- Listing Button Show --}}
@if ($Totalhotels->count() > 7)
@endif
@if ($Totalrestaurant->count() > 7)
@endif
@if ($Totalbeauty->count() > 7)
@endif
@if ($TotalrealEstate->count() > 7)
@endif
@if ($Totalcar->count() > 7)
@endif
{{-- Listing Button Show --}}