{!! csrf_field() !!}

{{ $title }}

{{ trans('settings.webhooks_details_desc') }}

@include('form.toggle-switch', [ 'name' => 'active', 'value' => old('active') ?? $model->active ?? true, 'label' => trans('settings.webhooks_active'), ]) @include('form.errors', ['name' => 'active'])
@include('form.text', ['name' => 'name'])
@include('form.text', ['name' => 'endpoint'])
@include('form.errors', ['name' => 'events'])

{{ trans('settings.webhooks_events_desc') }}

{{ trans('settings.webhooks_events_warning') }}

@include('form.custom-checkbox', [ 'name' => 'events[]', 'value' => 'all', 'label' => trans('settings.webhooks_events_all'), 'checked' => old('events') ? in_array('all', old('events')) : (isset($webhook) ? $webhook->tracksEvent('all') : false), ])

@foreach(\BookStack\Actions\ActivityType::all() as $activityType)
@include('form.custom-checkbox', [ 'name' => 'events[]', 'value' => $activityType, 'label' => $activityType, 'checked' => old('events') ? in_array($activityType, old('events')) : (isset($webhook) ? $webhook->tracksEvent($activityType) : false), ])
@endforeach
{{ trans('common.cancel') }} @if ($webhook->id ?? false) {{ trans('settings.webhooks_delete') }} @endif