@foreach($projects as $project) {{ $project->quotation ? strtoupper(substr($project->quotation->state_code ?? '', 0, 2)) . '-' . \Carbon\Carbon::parse($project->quotation->created_at)->format('y') . '-' . str_pad($project->quotation->id ?? 0, 3, '0', STR_PAD_LEFT) : '' }} {{ $project->title }} {{ $project->client_name }} @php $statusColors = [ 'active' => ['bg' => '#E7F1FF', 'color' => '#0d6efd'], 'pending' => ['bg' => '#C8B20A1F', 'color' => '#C8B20A'], 'completed' => ['bg' => '#52B8571F', 'color' => '#0AC84D'], 'cancelled' => ['bg' => '#C80A0A1F', 'color' => '#EC140D'], ]; $status = strtolower($project->status); $colors = $statusColors[$status] ?? ['bg' => '#E7F1FF', 'color' => '#0d6efd']; @endphp {{ ucfirst($project->status) }} @php $progressValue = $project->progress ?? 0; if ($progressValue < 40) $color = 'bg-danger'; elseif ($progressValue < 70) $color = 'bg-warning'; else $color = 'bg-success'; @endphp
{{ $progressValue }}%
{{ $project->description ?? '-' }} {{ $project->updated_by ?? '-' }} - - @endforeach