@php $total = $hooks->count(); $active = $hooks->where('is_active', true)->count(); $received = $hooks->sum('received_count'); @endphp
{{-- ════════════════ LEFT RAIL ════════════════ --}} {{-- ════════════════ MAIN ════════════════ --}}
{{-- Title row --}}
{{ __('Webhooks') }} / {{ __('Incoming') }}

{{ __('Incoming') }} {{ __('webhooks') }}

{{ __('A URL we host that receives data FROM other services — the opposite of an outgoing webhook. Generate one, give it out, and every request shows up below for you to inspect or relay onward.') }}

{{-- Flash --}} @if (session('status'))
{{ session('status') }}
@endif @if ($errors->any())
{{ $errors->first() }}
@endif {{-- Generate card --}}
{{ __('New listener') }}

{{ __('Generate a webhook URL') }}

@csrf
{{-- The list of generated URLs --}} @forelse ($hooks as $hook) @php $url = $hook->publicUrl(); @endphp
{{-- Card header --}}
{{ $hook->name ?: __('Incoming webhook') }} {{ $hook->is_active ? __('Live') : __('Paused') }}
{{ $hook->received_count }} {{ __('received') }} @if ($hook->last_received_at) · {{ __('last') }} {{ $hook->last_received_at->diffForHumans() }} @endif
@csrf
@csrf
@csrf @method('DELETE')
{{-- LEFT: URL + captured requests --}}
{{-- URL --}}
{{ __('Accepts POST / GET / PUT / PATCH. Anyone with this URL can post to it — keep it private.') }}
{{-- Captured requests --}}
{{ __('Captured requests') }} {{ __('Refresh') }}
@if ($hook->events->isEmpty())
{{ __('Nothing received yet. Send a test request to the URL above and it appears here instantly.') }}
@else
@foreach ($hook->events as $ev)
{{ $ev->method }} {{ optional($ev->received_at)->diffForHumans() }} {{ $ev->source_ip }} @if ($ev->lead_contact_id) {{ __('lead saved') }} @endif @if ($ev->forwarded) {{ __('relayed') }}{{ $ev->forward_status ? ' ' . $ev->forward_status : '' }} @endif
@if ($ev->content_type)
{{ $ev->content_type }}
@endif
{{ __('Headers') }}
{{ json_encode($ev->headers, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) }}
{{ __('Body') }}
{{ $ev->payload ?: '(empty)' }}
@if ($ev->forward_error)
{{ __('Relay error') }}: {{ $ev->forward_error }}
@endif
@endforeach
@endif
{{-- RIGHT: forward / relay --}}
@empty
{{ __('No incoming webhooks yet') }}

{{ __('Use the form above to generate your first URL. Whatever any service sends to it will appear right here, and you can forward it to your own system.') }}

@endforelse