@extends('layouts.app') @php use App\Services\CapaLifecycleService; /** * Defensive date formatter (accepts Carbon, string, or null). */ $fmtDate = function ($value, string $format = 'M j, Y H:i') { if (empty($value)) return '—'; try { return \Illuminate\Support\Carbon::parse($value)->format($format); } catch (\Throwable $e) { return (string) $value; } }; $pendingInstance = $capa->latestApprovalInstance(); $hasPending = $pendingInstance && in_array($pendingInstance->status, ['PENDING', 'IN_PROGRESS'], true); @endphp @section('title', $capa->capa_number . ' — ' . $capa->title) @section('content')
#{{ $pendingInstance->instance_id }}
is pending at step {{ $pendingInstance->current_step }}.
@if($pendingInstance->workflow)
{{ $pendingInstance->workflow->workflow_name }}
@endif
{{ $capa->problem_statement }}
{{ $capa->root_cause_summary }}
@if($capa->root_cause_method) Method / Source: {{ str_replace('_', ' ', $capa->root_cause_method) }} @endif @else{{ Str::limit($inv->investigation_scope, 250) }}
No investigations recorded.
@endforelse| Type | Description | Responsible | Due | Status | Actions |
|---|---|---|---|---|---|
| {{ $a->action_type }} | {{ Str::limit($a->action_description, 60) }} | {{ $a->responsible?->name ?? '—' }} | {{ $fmtDate($a->due_date, 'M j, Y') }} @if($a->isOverdue()) Overdue @endif | {{ $a->status }} | |
| No actions recorded. | |||||
{{ Str::limit($eff->results, 250) }}
No effectiveness checks recorded.
@endforelseNo extensions requested.
@endforelse| Date | User | Action | Description |
|---|---|---|---|
| {{ $fmtDate($t->changed_at, 'M j, Y H:i') }} | {{ $t->user?->name ?? 'System' }} | {{ $t->action_type }} |
{{ $t->action_description }} |
| No audit entries. | |||