@extends('layouts.app') @section('title', 'Approval Instances') @section('content')
{{-- Header --}}

Approval Instances

Reset
{{-- Stats --}}
@php $total = array_sum($statusCounts); $cards = [ ['Total', $total, 'primary'], ['Pending', $statusCounts['PENDING'] ?? 0, 'warning'], ['In Progress', $statusCounts['IN_PROGRESS'] ?? 0, 'info'], ['Approved', $statusCounts['APPROVED'] ?? 0, 'success'], ['Rejected', $statusCounts['REJECTED'] ?? 0, 'danger'], ]; @endphp @foreach($cards as [$label, $value, $color])
{{ $label }}
{{ number_format($value) }}
@endforeach
{{-- Table --}}
@forelse($instances as $instance) @empty @endforelse
ID Record Workflow Module Initiator Initiated Current Step Status Completed Actions
#{{ $instance->instance_id }} {{ $instance->record_number ?: '#' . $instance->record_id }}
{{ Str::limit($instance->record_title ?: $instance->record_type, 50) }}
{{ $instance->workflow?->workflow_name }} {{ $instance->record_type }} {{ $instance->initiator?->name ?? '—' }} {{ $instance->initiated_at?->format('M j, Y H:i') }} @if(in_array($instance->status, ['PENDING', 'IN_PROGRESS'], true)) Step {{ $instance->current_step }} @else @endif {{ $instance->status }} @if($instance->completed_at) {{ $instance->completed_at->format('M j, Y') }}
{{ $instance->finalDecisionBy?->name }} @else — @endif
@if(in_array($instance->status, ['PENDING', 'IN_PROGRESS'], true)) @endif
No approval instances found.
{{ $instances->withQueryString()->links() }}
{{-- Filter modal --}} @endsection @push('scripts') @endpush