@extends('admin.layouts.app') @section('title', __('admin.notification_logs_admin.show_title') . ' #' . $log->id . ' — ' . __('admin.brand.name')) @section('page_title', __('admin.notification_logs_admin.show_title')) @php use App\Models\NotificationLog; $dash = '—'; $channelLabel = trans()->has('admin.notification_logs_admin.channels.' . $log->channel) ? __('admin.notification_logs_admin.channels.' . $log->channel) : $log->channel; $statusLabel = trans()->has('admin.notification_logs_admin.statuses.' . $log->status) ? __('admin.notification_logs_admin.statuses.' . $log->status) : $log->status; $statusColor = match ($log->status) { NotificationLog::STATUS_SENT => ['fg' => '#065f46', 'bg' => '#d1fae5'], NotificationLog::STATUS_FAILED => ['fg' => '#991b1b', 'bg' => '#fee2e2'], NotificationLog::STATUS_PENDING => ['fg' => '#92400e', 'bg' => '#fef3c7'], default => ['fg' => '#475569', 'bg' => '#f1f5f9'], }; $recipientUrl = null; if ($log->recipient_type === \App\Models\Investor::class && $log->recipient_id) { $recipientUrl = route('admin.investors.show', $log->recipient_id); } elseif ($log->recipient_type === \App\Models\Startup::class && $log->recipient_id) { $recipientUrl = route('admin.startups.show', $log->recipient_id); } @endphp @section('content') {{ __('admin.notification_logs_admin.back_to_list') }}
{{-- ────── Summary card ────── --}}
@if ($log->status === NotificationLog::STATUS_SENT) ✓ @elseif ($log->status === NotificationLog::STATUS_FAILED) ✗ @else ⏳ @endif

{{ $channelLabel }} · {{ $statusLabel }}

{{ optional($log->created_at)->format('Y-m-d H:i:s') }} @if ($log->sent_at) · sent {{ $log->sent_at->format('H:i:s') }} ({{ $log->sent_at->diffForHumans() }}) @endif

{{ $log->address ?: '—' }}
{{-- ────── Error block (only when failed) ────── --}} @if ($log->status === NotificationLog::STATUS_FAILED && ($log->error || $log->error_code))

{{ __('admin.notification_logs_admin.fields.error') }}

@if ($log->error_code)
{{ $log->error_code }}
@endif @if ($log->error)
{{ $log->error }}
@endif
@endif {{-- ────── Two-column grid: recipient / change / admin ────── --}}

👤 {{ __('admin.notification_logs_admin.fields.recipient') }}

{{ __('admin.notification_logs_admin.fields.recipient_type') }}
{{ class_basename($log->recipient_type) }}#{{ $log->recipient_id }} @if ($log->recipient && $recipientUrl) @endif
{{ __('admin.notification_logs_admin.fields.address') }}
{{ $log->address ?: $dash }}

🔁 {{ __('admin.notification_logs_admin.fields.change') }}

{{ __('admin.notification_logs_admin.fields.triggered_event') }}
{{ $log->triggered_event ?: $dash }}
{{ __('admin.notification_logs_admin.fields.label_key') }}
{{ $log->label_key ?: $dash }}
{{ __('admin.notification_logs_admin.fields.old_value') }}
{{ $log->old_value ?: $dash }}
{{ __('admin.notification_logs_admin.fields.new_value') }}
{{ $log->new_value ?: $dash }}

🛡️ {{ __('admin.notification_logs_admin.fields.admin') }}

{{ __('admin.notification_logs_admin.fields.admin') }}
@if ($log->admin) {{ $log->admin->name }} {{ $log->admin->email }} @else {{ $dash }} @endif

🕒 {{ __('admin.notification_logs_admin.fields.timestamps') }}

{{ __('admin.notification_logs_admin.fields.created_at') }}
{{ optional($log->created_at)->format('Y-m-d H:i:s') ?: $dash }}
{{ __('admin.notification_logs_admin.fields.sent_at') }}
{{ optional($log->sent_at)->format('Y-m-d H:i:s') ?: $dash }}
{{-- ────── Payload (the option / event context the listener wrote) ────── --}} @if (! empty($log->payload))

📦 {{ __('admin.notification_logs_admin.fields.payload') }}

{{ json_encode($log->payload, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) }}
@endif {{-- ────── Provider response — useful for debugging delivery ────── --}} @if (! empty($log->response))

📡 {{ __('admin.notification_logs_admin.fields.response') }}

{{ json_encode($log->response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) }}
@endif
@push('styles') @endpush @endsection