@extends('layouts.app') @section('mobile-title', $project->name) @section('mobile-subtitle', $project->code.' · '.$project->location) @section('mobile-back', route('projects.index')) @if ($project->status === 'active') @section('mobile-action-url', route('reports.create', ['project_id' => $project->id])) @section('mobile-action-icon', 'add') @section('mobile-action-label', 'New report') @endif @section('content') @php $reports = $project->reports->sortByDesc('work_date'); $totalReports = $project->reports->count(); $approvedReports = $project->reports->where('status', \App\Models\Report::STATUS_APPROVED)->count(); $submittedReports = $project->reports->where('status', \App\Models\Report::STATUS_SUBMITTED)->count(); $completion = $totalReports > 0 ? round(($approvedReports / $totalReports) * 100) : 0; $lead = $project->supervisors->first() ?: $project->technicians->first(); $galleryPhotos = $reports ->flatMap(fn ($report) => $report->photos->map(fn ($photo) => ['photo' => $photo, 'report' => $report])) ->take(8); $featuredPhoto = $galleryPhotos->first(); @endphp
ID: {{ $project->code }} · {{ $project->location }}
Photos uploaded through field reports will appear here automatically.
{{ $galleryPhotos->count() }} recent photo{{ $galleryPhotos->count() === 1 ? '' : 's' }} from field reports
| Report ID | Date | Inspector | Status | Action |
|---|---|---|---|---|
| {{ $report->reference_number }} | {{ $report->work_date->format('M j, Y') }} | {{ $report->technician->name }} | @include('partials.status-badge', ['status' => $report->status]) | View |
| No reports for this project yet. | ||||