{{-- API-nyckel form (#2957 slice 6c, card #3020). Included by apiKey/edit only. Expects: $key, $props (prop name => value), $tableCode (the rendered partials/subscribeForm, a string once the view gathers its data). - PUT api.update with status, name and, as before, only the fields the key has props for: domain, receiverList, sms_sender_name (SMS keys), and for non-SMS keys returnUrl, props[] and html_code (read-only; the controller ignores it). The old returnUrl default was an unparenthesized nested ternary, a fatal error on PHP 8 that took the whole page down. - The signup code is shown exactly as generated, escaped for display only, with a copy button. - DELETE api.destroy in its own form, confirmed in a native dialog. --}} @php $status = (string) old('status', $key['status']); $isSms = isset($props['sms_sender_name']); $storedProps = ! empty($props['props']) ? collect(json_decode($props['props'])) : collect(); @endphp
@csrf @method('PUT') @isset($props['domain']) @endisset @isset($props['receiverList']) @include('apiKey.partials.nh-list-select', [ 'lists' => Auth::user()->company->receiverLists()->orderBy('name')->get(), 'selected' => old('receiverList') ?: $props['receiverList'], ]) @endisset @if ($isSms) @else @include('apiKey.partials.nh-props', ['checked' => fn ($name) => old('props.'.$name) || $storedProps->has($name)])
{{ __('api.nh.edit.codeHint') }} @include('senderprofile.partials.nh-copy', [ 'target' => 'html_code', 'label' => __('api.nh.edit.copy'), 'copied' => __('api.nh.edit.copied'), 'failed' => __('api.nh.edit.copyFailed'), ])
@endif {{ __('api.form.save') }} {{ __('api.nh.cancel') }}
@csrf @method('DELETE')
@include('senderprofile.partials.nh-confirm', [ 'dialogId' => 'nh-apidelete-dialog', 'title' => __('api.nh.delete.title'), 'text' => __('api.nh.delete.text'), 'cancel' => __('api.nh.delete.cancel'), 'confirm' => __('api.nh.delete.confirm'), 'danger' => true, ])