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,