@extends('layouts.app') @section('title', 'API Receiver Details') @section('breadcrumb') @endsection @section('content')

{{ $apiReceiver->name }}

@if(!$apiReceiver->is_active) @endif
Total Received
{{ number_format($apiReceiver->total_received ?? 0) }}
Success Rate
@php $totalLogs = $apiReceiver->receiveLogs()->count(); $successLogs = $apiReceiver->receiveLogs()->where('status_code', '>=', 200)->where('status_code', '<', 300)->count(); $successRate = $totalLogs > 0 ? round(($successLogs / $totalLogs) * 100, 1) : 0; @endphp {{ $successRate }}%
Today's Received
{{ $apiReceiver->receiveLogs()->whereDate('created_at', today())->count() }}
Last Received
@if($apiReceiver->last_received_at) @php $lastReceived = $apiReceiver->last_received_at; if (is_string($lastReceived)) { $lastReceived = \Carbon\Carbon::parse($lastReceived); } @endphp {{ $lastReceived->diffForHumans() }} @else Never @endif
Receiver Details
{{ $apiReceiver->name }}
{{ url('/api/in/' . $apiReceiver->endpoint) }}
{{ $apiReceiver->target_table }}
@php $methods = is_array($apiReceiver->allowed_methods) ? $apiReceiver->allowed_methods : explode(',', $apiReceiver->allowed_methods); @endphp @foreach($methods as $method) {{ trim($method) }} @endforeach
{{ $apiReceiver->is_active ? 'Active' : 'Inactive' }}
{{ ucfirst(str_replace('_', ' ', $apiReceiver->auth_type)) }}
@if($apiReceiver->rate_limit)
{{ number_format($apiReceiver->rate_limit) }} requests/hour
@endif
{{ $apiReceiver->auto_create_table ? 'Yes' : 'No' }}
@if($apiReceiver->description)
{{ $apiReceiver->description }}
@endif @if($apiReceiver->field_mapping)
{{ json_encode($apiReceiver->field_mapping, JSON_PRETTY_PRINT) }}
@endif
Quick Actions
View All Logs @if($apiReceiver->is_active) @else @endif
Recent Activity
@php $recentLogs = $apiReceiver->receiveLogs()->latest('created_at')->limit(5)->get(); @endphp @if($recentLogs->count() > 0) @foreach($recentLogs as $log)
{{ $log->status_code >= 200 && $log->status_code < 300 ? 'Success' : 'Error' }} from {{ $log->ip_address }}
{{ $log->created_at->diffForHumans() }}
@endforeach @else
No activity yet
Data received will appear here
@endif
@endsection @section('scripts') @endsection