@extends('layouts.user.profile.layout') @section('title') {{ $websiteLang->where('lang_key','wishlist')->first()->custom_text }} @endsection @section('user-dashboard')

{{ $websiteLang->where('lang_key','wishlist')->first()->custom_text }}

@foreach ($wishlists as $item) @endforeach
{{ $websiteLang->where('lang_key','img')->first()->custom_text }} {{ $websiteLang->where('lang_key','property')->first()->custom_text }} {{ $websiteLang->where('lang_key','date_added')->first()->custom_text }} {{ $websiteLang->where('lang_key','views')->first()->custom_text }} {{ $websiteLang->where('lang_key','action')->first()->custom_text }}
img
{{ $item->property->title }}

{{ $item->property->address.', '.$item->property->city->name }}

@php $total_review=$item->property->reviews->where('status',1)->count(); if($total_review > 0){ $avg_sum=$item->property->reviews->where('status',1)->sum('avarage_rating'); $avg=$avg_sum/$total_review; $intAvg=intval($avg); $nextVal=$intAvg+1; $reviewPoint=$intAvg; $halfReview=false; if($intAvg < $avg && $avg < $nextVal){ $reviewPoint= $intAvg + 0.5; $halfReview=true; } } @endphp @if ($total_review > 0)

{{ sprintf("%.1f", $reviewPoint) }} @for ($i = 1; $i <=5; $i++) @if ($i <= $reviewPoint) @elseif ($i> $reviewPoint ) @if ($halfReview==true) @php $halfReview=false @endphp @else @endif @endif @endfor ({{ $total_review }} {{ $websiteLang->where('lang_key','review')->first()->custom_text }})

@else

0.0 @for ($i = 1; $i <=5; $i++) @endfor ({{ 0 }} {{ $websiteLang->where('lang_key','review')->first()->custom_text }})

@endif

{{ $item->created_at->format('Y-m-d') }}

{{ $item->property->views }}

{{ $wishlists->links('user.paginator') }}
@endsection