@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')
{{ 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 ?: '—' }}
{{ $log->error }}
@endif
{{ class_basename($log->recipient_type) }}#{{ $log->recipient_id }}
@if ($log->recipient && $recipientUrl)
@endif
{{ $log->address ?: $dash }}{{ $log->label_key ?: $dash }}{{ json_encode($log->payload, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) }}
{{ json_encode($log->response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) }}