@extends('user.layout') @section('title') {{ __('Wishlists') }} @endsection @section('user-dashboard')

{{ __('Wishlist') }}

@foreach ($wishlists as $wishlist) @endforeach
{{ __('Image') }} {{ __('Property') }} {{ __('Date') }} {{ __('Views') }} {{ __('Action') }}
img
{{ $wishlist->property->translation?->title }}

{{ $wishlist->property->translation?->address . ', ' . $wishlist->property->city?->title }}

@php $total_review = $wishlist->property->reviews->where('status', 1)->count(); if ($total_review > 0) { $avg_sum = $wishlist->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 }} {{ __('Reviews') }})

@else

0.0 @for ($i = 1; $i <= 5; $i++) @endfor ({{ 0 }} {{ __('Reviews') }})

@endif

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

{{ $wishlist->property->views }}

{{ $wishlists->links('custom_paginator') }}
@endsection