@if ($accessError)
{{ $accessError }}
@else
@if($editingId)

{{ __('Edit Webhook') }}

{{ __('Update webhook configuration') }}

@else

{{ __('webhooks::webhooks.create_webhook') }}

{{ __('webhooks::webhooks.create_webhook_subtitle') }}

@endif
@if($editingId) @else @endif
@error('name')

{{ $message }}

@enderror
@error('target_url')

{{ $message }}

@enderror
@error('secret')

{{ $message }}

@enderror
@error('max_attempts')

{{ $message }}

@enderror
@error('backoff_seconds')

{{ $message }}

@enderror
{{ __('Webhooks created here apply only to the current branch.') }}
@foreach (['order.created','order.updated','reservation.received','reservation.confirmed','kot.updated'] as $event) @endforeach
@error('subscribed_events.*')

{{ $message }}

@enderror
@foreach (['Order','Reservation','Kitchen','Inventory'] as $module) @endforeach
@error('source_modules.*')

{{ $message }}

@enderror

{{ __('webhooks::webhooks.configured_webhooks') }}

@if (count($webhooks) === 0)

{{ __('webhooks::webhooks.no_webhooks_yet') }}

@else
@foreach ($webhooks as $hook) @endforeach
{{ __('webhooks::webhooks.name') }} {{ __('webhooks::webhooks.target_url') }} {{ __('webhooks::webhooks.branch') }} {{ __('webhooks::webhooks.subscribed_events') }} {{ __('webhooks::webhooks.status') }} {{ __('webhooks::webhooks.actions') }}
{{ $hook['name'] }} {{ $hook['target_url'] }} {{ $hook['branch_id'] ? '#'.$hook['branch_id'] : __('webhooks::webhooks.all_branches') }} @if (!empty($hook['subscribed_events'])) {{ count($hook['subscribed_events']) }} {{ __('webhooks::webhooks.event') }} @else {{ __('webhooks::webhooks.all_events') }} @endif {{ $hook['is_active'] ? __('webhooks::webhooks.is_active') : __('webhooks::webhooks.status_disabled') }} | | |
@endif

{{ __('webhooks::webhooks.recent_deliveries') }}

{{ __('webhooks::webhooks.latest_count', ['count' => 10]) }}
@if (count($recentDeliveries) === 0)

{{ __('webhooks::webhooks.no_deliveries') }}

@else
@foreach ($recentDeliveries as $delivery) @endforeach
{{ __('webhooks::webhooks.event') }} {{ __('webhooks::webhooks.status') }} {{ __('webhooks::webhooks.attempts') }} {{ __('webhooks::webhooks.response') }} {{ __('webhooks::webhooks.duration_ms') }} {{ __('webhooks::webhooks.created_at') }} {{ __('webhooks::webhooks.actions') }}
{{ $delivery['event'] }} {{ __('webhooks::webhooks.status_' . $delivery['status']) }} {{ $delivery['attempts'] }} {{ $delivery['response_code'] ?? '-' }} {{ $delivery['duration_ms'] ?? '-' }} {{ \Illuminate\Support\Carbon::parse($delivery['created_at'])->diffForHumans() }} |
@endif
@include('webhooks::livewire.admin.components.payload-modal') @include('webhooks::livewire.admin.components.webhook-details-modal') @endif