From ea1c64bf1abe09cc4965b69f1987deed88f83e9b Mon Sep 17 00:00:00 2001 From: Yusuf Date: Fri, 5 Aug 2022 16:17:20 +0700 Subject: [PATCH] projects on danger --- app/Http/Controllers/ProjectController.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Http/Controllers/ProjectController.php b/app/Http/Controllers/ProjectController.php index 578ce35..bb9d679 100644 --- a/app/Http/Controllers/ProjectController.php +++ b/app/Http/Controllers/ProjectController.php @@ -257,6 +257,7 @@ class ProjectController extends Controller $totalActualCost = $data->sum('actualCost'); // $manpowers = User::where('employee_type', 'employee')->count(); $manpowers = User::count(); + $projectsOnDanger = Project::where('budget_health', 'danger')->count(); $projectPhases = ProjectPhase::orderBy('order', 'asc')->pluck('name'); $projectTypes = ProjectType::orderBy('id', 'asc')->pluck('name'); try { @@ -288,6 +289,7 @@ class ProjectController extends Controller 'totalActualCost' => $totalActualCost, 'totalRevenue' => $totalPlannedCost - $totalActualCost, 'manpowers' => $manpowers, + 'projectsOnDanger'=> $projectsOnDanger, 'projectPhases' => $projectPhases, 'projectsByPhase' => $projectsByPhase, 'projectTypes' => $projectTypes,