64 lines
2.5 KiB
PHP
64 lines
2.5 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use Inertia\Inertia;
|
|
use Illuminate\Http\Request;
|
|
|
|
class DashboardController extends Controller
|
|
{
|
|
public function index(Request $request)
|
|
{
|
|
// For Phase 1, we return structured mock data tailored for a Site Execution Dashboard.
|
|
// Once the frontend is wired up, we can replace these with actual Eloquent queries
|
|
// to Modules\ProjectManagement\Models\Task and MaterialLogistics models.
|
|
|
|
$weather = [
|
|
'condition' => 'Scattered Thunderstorms',
|
|
'temp' => '84°F',
|
|
'high' => '88°F',
|
|
'low' => '72°F',
|
|
'forecast' => 'Rain expected at 2:00 PM. High winds (15mph).',
|
|
'color' => 'amber' // alert indicator
|
|
];
|
|
|
|
$activities = [
|
|
['id' => 1, 'time' => '07:00 AM', 'title' => 'Site Opens & Safety Toolbox Talk', 'status' => 'completed'],
|
|
['id' => 2, 'time' => '09:00 AM', 'title' => 'Concrete Pour (Foundation Sec B)', 'status' => 'in_progress'],
|
|
['id' => 3, 'time' => '01:00 PM', 'title' => 'Steel Delivery (Supplier A)', 'status' => 'pending'],
|
|
['id' => 4, 'time' => '03:30 PM', 'title' => 'City Inspector Walk-through', 'status' => 'pending'],
|
|
];
|
|
|
|
$blockers = [
|
|
['id' => 101, 'type' => 'RFI', 'title' => 'RFI #42: Balcony Rebar Specifications Unclear', 'urgency' => 'high'],
|
|
['id' => 102, 'type' => 'Material', 'title' => 'Delayed Cement Delivery (Truck breakdown)', 'urgency' => 'critical'],
|
|
['id' => 103, 'type' => 'Safety', 'title' => 'Guardrails missing on 3rd floor west wing', 'urgency' => 'high'],
|
|
];
|
|
|
|
$resources = [
|
|
'labor' => [
|
|
'expected' => 45,
|
|
'actual' => 42,
|
|
'trades' => ['Carpenters' => 12, 'Electricians' => 6, 'Laborers' => 24]
|
|
],
|
|
'equipment' => [
|
|
'active' => 3,
|
|
'maintenance' => 1,
|
|
'idle' => 2,
|
|
'list' => [
|
|
['name' => 'Excavator Cat 320', 'status' => 'active'],
|
|
['name' => 'Tower Crane 1', 'status' => 'active'],
|
|
['name' => 'Skid Steer', 'status' => 'maintenance'],
|
|
]
|
|
]
|
|
];
|
|
|
|
return Inertia::render('Dashboard', [
|
|
'weather' => $weather,
|
|
'activities' => $activities,
|
|
'blockers' => $blockers,
|
|
'resources' => $resources,
|
|
]);
|
|
}
|
|
}
|