@foreach ($this->statuses() as $st) @endforeach
@forelse ($requests as $r) @php $tones = [ 'pending' => 'warning', 'in_progress' => 'info', 'completed' => 'success', 'rejected' => 'neutral', 'failed' => 'danger', ]; $tone = $tones[$r->status] ?? 'neutral'; $svc = $r->order?->service; $svcLabel = $svc ? (($r->order->api_service_id ? $r->order->api_service_id . ' – ' : '') . \Illuminate\Support\Str::limit($svc->name, 40)) : '—'; $provResponse = $r->provider_response ? \Illuminate\Support\Str::limit(is_array($r->provider_response) ? json_encode($r->provider_response, JSON_UNESCAPED_UNICODE) : (string) $r->provider_response, 120) : '—'; $canRetry = in_array($r->status, ['failed', 'rejected']); @endphp {{-- Request ID --}} {{-- Order ID --}} {{-- Client --}} {{-- Service --}} {{-- Provider --}} {{-- Date --}} {{-- Status --}} {{-- Provider response --}} {{-- Actions --}} @empty @endforelse
{{ __('Req. ID') }} {{ __('Order') }} {{ __('Client') }} {{ __('Service') }} {{ __('Provider') }} {{ __('Date') }} {{ __('Status') }} {{ __('Provider Response') }} {{ __('Actions') }}
#{{ $r->id }}
{{ $r->order_id }}
{{ $r->order?->user?->name ?? '—' }}
{{ $r->order?->user?->email ?? '' }}
{{ $svcLabel }}
{{ $r->order?->provider?->name ?? '—' }}
{{ rf_date($r->created_at) }}
{{ rf_date($r->created_at, 'H:i:s') }}
{{ __(ucfirst(str_replace('_', ' ', $r->status))) }} @if ($r->source === 'api')
API
@endif
{{ $provResponse }} {{-- View details link to order --}} {{ __('View order') }} @if (in_array($r->status, ['pending', 'in_progress'])) @endif @if ($canRetry) @endif
@if ($requests->hasPages())
{{ $requests->links() }}
@endif