@php
$from = session('from_date');
$to = session('to_date');
$total = \App\Models\Order::whereBetween('created_at', [$from, $to])->count();
if ($total == 0) {
$total = 0.01;
}
@endphp
@php
$delivered = \App\Models\Order::where(['order_status' => 'delivered'])
->whereBetween('created_at', [$from, $to])
->count();
@endphp
@php
$returned = \App\Models\Order::where(['order_status' => 'returned'])
->whereBetween('created_at', [$from, $to])
->count();
@endphp
@php
$failed = \App\Models\Order::where(['order_status' => 'failed'])
->whereBetween('created_at', [$from, $to])
->count();
@endphp
@php
$canceled = \App\Models\Order::where(['order_status' => 'canceled'])
->whereBetween('created_at', [$from, $to])
->count();
@endphp