@extends('layouts.app') @section('mobile-title', 'Projects') @section('mobile-subtitle', 'Sites and progress') @can('create', \App\Models\Project::class) @section('mobile-action-url', route('projects.create')) @section('mobile-action-icon', 'add') @section('mobile-action-label', 'New project') @endcan @section('content') @php $visibleProjects = collect($projects->items()); $activeCount = $visibleProjects->where('status', 'active')->count(); $onHoldCount = $visibleProjects->where('status', 'on_hold')->count(); $teamCount = $visibleProjects->sum(fn ($project) => ($project->technicians_count ?? 0) + ($project->supervisors_count ?? 0)); @endphp

Projects Overview

Manage and monitor active construction sites.

@if (auth()->user()->isAdmin())
Export CSV New project
@endif
Active projects
domain
{{ $activeCount }}
In current view
Total reports
summarize
{{ $visibleProjects->sum('reports_count') }}
Across visible sites
Teams on-site
groups
{{ $teamCount }}
Assigned users
Urgent compliance
warning
{{ $onHoldCount }}
Requires attention
@forelse ($projects as $project) @php $completion = ($project->reports_count ?? 0) > 0 ? min(100, max(8, ($project->reports_count * 12) % 100)) : 0; $barColor = $project->status === 'on_hold' ? 'bg-amber-700' : ($project->status === 'complete' ? 'bg-blue-700' : 'bg-emerald-800'); @endphp
@include('partials.status-badge', ['status' => $project->status]) construction

{{ $project->name }}

{{ $project->code }} ยท {{ $project->client_name }}

Overall Progress {{ $completion }}%
location_on Location
{{ $project->location }}
fact_check Reports
{{ $project->reports_count }} total
View Details @if (auth()->user()->isAdmin()) more_vert @endif
@empty
No projects yet.
@endforelse
{{ $projects->links() }}
@endsection