@extends('layouts.app') @section('content') @php $resto = isset(\Illuminate\Support\Facades\Auth::user()->restaurants)?\Illuminate\Support\Facades\Auth::user()->restaurants:NULL; @endphp

{!! isset($resto)?($resto->orders->count()):0; !!}

Total Order

{{--

3% (15 Days)

--}}

{!! isset($resto)?($resto->delivered_orders->count()):0; !!}

Total Delivered

{{--

8% (15 Days)

--}}

{!! isset($resto)?($resto->cancelled_by_customer_orders->count()):0; !!}

Total Cancelled

{{--

2% (15 Days)

--}}
@php $totalRevenue = \App\Restaurants::totalRevenue($resto->id); $last7DaysData = \App\Restaurants::totalRevenueLast7Days($resto->id); $last7DaysDataCount = \App\Restaurants::totalCountRevenue($resto->id); $totalOnlineOrders = \App\Restaurants::totalOnlineOrders($resto->id); $totalOnlineOrders7Days = \App\Restaurants::totalOnlineOrdersLast7Days($resto->id); $totalCountOnlineOrders7Days = \App\Restaurants::totalCountOnlineOrdersLast7Days($resto->id); $last7DaysData = isset($last7DaysData)?$last7DaysData:NULL; @endphp

IQD {!! isset($totalRevenue)?number_format($totalRevenue[0]->total_price):0 !!}

Total Revenue

{{--

12% (15 Days)

--}}

Daily Revenue

IQD {!! isset($last7DaysDataCount)?number_format($last7DaysDataCount[0]->total_price):0 !!}

Customer Flow

{!! isset($totalCountOnlineOrders7Days)?$totalCountOnlineOrders7Days[0]['total_orders']:0 !!}

Online Order

@endsection @section('js') @endsection