@php use App\Order; use App\Cart; use App\Shipping; use App\Shop; function monthWiseSell($month) { $current_year = date("Y"); $total_sell = Order::whereMonth('created_at', '=', $month)->whereYear('created_at','=', $current_year)->where('delivery_status', "Delivered")->get(); $total = 0; foreach ($total_sell as $sell) { $total += $sell->price; } return $total; } if (isset($_GET['form_date'])) { $from = $_GET['form_date']; $to = $_GET['to_date']; $orders = Order::whereBetween('created_at', [$from, $to])->get(); } @endphp @extends('backend.layouts.master') @section('content')