@foreach ($most_rated_products as $key => $item)
@php($product = \App\Model\Product::find($item['product_id']))
@if (isset($product))
{{ isset($product) ? substr($product->name, 0, 18) . (strlen($product->name) > 18 ? '...' : '') : 'not exists' }}
{{ $avg_rating = count($product->rating) > 0 ? number_format($product->rating[0]->average, 2, '.', ' ') : 0 }}
({{ $item['total'] }})