{{ $document->title }}

Download @if(Auth::user()->hasRole('Contractor') && $document->contractor_id === Auth::id()) History @endif Back to Documents
@if(session('success'))
{{ session('success') }}
@endif

Document Details

{{ $document->title }}

{{ $document->type }}

{{ $document->contractor->name }}

{{ $document->current_status }}

{{ $document->created_at->format('M d, Y \a\t g:i A') }}

v{{ $document->versions->max('version_number') ?? 1 }}

@if(Auth::user()->hasRole('Contractor') && $document->contractor_id === Auth::id() && !str_contains($document->current_status, 'Final Approved'))

Upload New Version

@csrf
@endif

Approval History

@if($document->approvals->count() > 0)
@foreach($document->approvals->sortBy('created_at') as $approval)
@if($approval->status === 'approved')
@elseif($approval->status === 'rejected')
@else
@endif

{{ $approval->reviewer->name }}

{{ ucfirst($approval->status) }}

{{ $approval->role }} • {{ $approval->created_at->diffForHumans() }}

@if($approval->comments)

{{ $approval->comments }}

@endif
@endforeach
@else

No approvals yet

@endif
@if(Auth::user()->hasRole(['Consultant', 'ClientA', 'ClientB', 'ClientC'])) @php $canReview = false; if (Auth::user()->hasRole('Consultant') && $document->current_status === 'Pending Consultant Review') $canReview = true; elseif (Auth::user()->hasRole('ClientA') && $document->current_status === 'Pending Client A Review') $canReview = true; elseif (Auth::user()->hasRole(['ClientB', 'ClientC']) && $document->current_status === 'Pending Client B & C Review') $canReview = true; @endphp @if($canReview)

Review Actions

@endif @endif