customer report

This commit is contained in:
omair saleh
2021-10-02 15:22:28 +08:00
parent 93c9412298
commit 33f152ae9c
2 changed files with 5 additions and 1 deletions
@@ -4,6 +4,7 @@ namespace App\Http\Controllers\Reports;
use App\Classes\ValueObjects\Constants\HttpStatus;
use App\Classes\ValueObjects\Response\ApiResponseObject;
use App\Models\Company;
use App\Models\Container;
use App\Models\Order;
use Carbon\Carbon;
@@ -52,6 +53,7 @@ class MonthlyReportController
'containers' => count($containers),
'activated_orders' => $activeOrders,
'active_customers' => count($customers),
'new_customers' => Company::whereMonth('created_at', $month->format('m'))->count(),
'total_cbm' => $customers->sum(function($customer){
return $customer['cbm'];
}),