@if(count($product->reviews) > 0) @if(count($product->reviews->where('approved', 1)->where('rating', '!=', null)) > 0)
@if(count($product->reviews->where('approved', 1)) > 0)

{{$product->reviews->where('approved', 1)->where('rating', '!=', null)->avg('rating')}}

{{count($product->reviews->where('approved', 1)->where('rating', '!=', null))}} @lang('Ratings &') {{count($product->reviews->where('approved', 1)->where('comment', '!=', null))}} @lang('Reviews')
@endif

@lang('Reviews & Ratings')

5
{{(count($product->reviews->where('approved', 1)->where('rating', 5)) / count($product->reviews->where('approved', 1)->where('rating', '!=', null))) * 100}}% Complete (danger)
{{count($product->reviews->where('approved', 1)->where('rating', 5))}}
4
{{(count($product->reviews->where('approved', 1)->where('rating', 4)) / count($product->reviews->where('approved', 1)->where('rating', '!=', null))) * 100}}% Complete (danger)
{{count($product->reviews->where('approved', 1)->where('rating', 4))}}
3
{{(count($product->reviews->where('approved', 1)->where('rating', 3)) / count($product->reviews->where('approved', 1)->where('rating', '!=', null))) * 100}}% Complete (danger)
{{count($product->reviews->where('approved', 1)->where('rating', 3))}}
2
{{(count($product->reviews->where('approved', 1)->where('rating', 2)) / count($product->reviews->where('approved', 1)->where('rating', '!=', null))) * 100}}% Complete (danger)
{{count($product->reviews->where('approved', 1)->where('rating', 2))}}
1
{{(count($product->reviews->where('approved', 1)->where('rating', 1)) / count($product->reviews->where('approved', 1)->where('rating', '!=', null))) * 100}}% Complete (danger)
{{count($product->reviews->where('approved', 1)->where('rating', 1))}}
@endif
@include('includes.approved_reviews', ['reviews' => $product->reviews()->where('approved', 1)->orderBy('id', 'desc')->paginate(10)])
@if($product->reviews()->where('approved', 1)->count() > 0)
@endif @if(Auth::check()) @foreach($product->reviews->where('approved', 0)->where('user_id', Auth::user()->id) as $review)
{{$review->user->name}} @for($i=1; $i <= 5; $i++) @endfor {{$review->created_at ? $review->created_at->toFormattedDateString() : '-'}} @if($review->user_id == Auth::user()->id) @endif

{{$review->comment}} (@lang('Pending for approval from administrators'))

@endforeach @endif @else

@lang('There are no reviews.')

@endif