@foreach ($restaurants as $key => $restaurant) {{ $key + 1 }}
{{ Str::limit($restaurant->name, 20, '...') }}
@php($reviews = $restaurant->reviews()->with('food',function($query){ $query->withoutGlobalScope(\App\Scopes\RestaurantScope::class); })->get()) @php($user_rating = null) @php($total_rating = 0) @php($total_reviews = 0) @foreach ($reviews as $key=>$value) @php($user_rating += $value->rating) @php($total_rating +=1) @php($total_reviews +=1) @endforeach @php($user_rating = isset($user_rating) ? ($user_rating)/count($reviews) : 0) @php($restaurant_rating = $restaurant['rating'] == null ? 0 : array_sum($restaurant['rating']) / 5) {{ number_format($user_rating, 1) }}
{{ $restaurant->vendor->f_name . ' ' . $restaurant->vendor->l_name }} {{ $restaurant['phone'] }} {{ $restaurant->email }} {{ $restaurant->zone ? $restaurant->zone->name : translate('messages.zone_deleted') }} @php($status = $restaurant->pivot ? $restaurant->pivot->campaign_status : translate('messages.not_found')) @if ($status == 'pending') {{ translate('messages.not_approved') }} @elseif($status == 'confirmed') {{ translate('messages.confirmed') }} @elseif($status == 'rejected') {{ translate('messages.rejected') }} @else {{ translate(str_replace('_', ' ', $status)) }} @endif @if ($restaurant->pivot && $restaurant->pivot->campaign_status == 'pending')
@elseif ($restaurant->pivot && $restaurant->pivot->campaign_status == 'rejected')
@else
@csrf @method('get')
@endif @endforeach