{{-- One PUT form retains details, custom fields and tag membership input across local panels. --}} @php $unsubscribedLists = $receiver->lists->filter(fn ($list) => (int) $list->pivot->status === 0); $status = (string) old('status', is_null($receiver->inactivated_at) ? '0' : '1'); $consentOptions = [ '0' => __('receiver.form.consentStatusConsented'), '1' => __('receiver.form.consentStatusNotConsent'), ] + (is_null($receiver->consent) ? ['2' => __('receiver.form.consentStatusUnconsented')] : []); $consent = (string) old('consent', ! is_null($receiver->consent) ? 0 : (! is_null($receiver->not_consent) ? 1 : 2)); $workspaceId = 'nh-receiver-'.$receiver->id; $workspaceTabs = ['details' => __('receiver_tabs.details'), 'tags' => __('receiver_tabs.tags'), 'email-statistics' => __('receiver_tabs.emailStatistics'), 'sms-statistics' => __('receiver_tabs.smsStatistics')]; $requestedReceiverTab = request()->query('tab'); $historyReceiverTab = request()->has('sms_history_page') && ! request()->has('email_history_page') ? 'sms-statistics' : 'email-statistics'; if ($requestedReceiverTab === 'statistics') { $requestedReceiverTab = $historyReceiverTab; } $initialReceiverTab = is_string($requestedReceiverTab) && array_key_exists($requestedReceiverTab, $workspaceTabs) ? $requestedReceiverTab : ((request()->has('email_history_page') || request()->has('sms_history_page')) ? $historyReceiverTab : 'details'); @endphp
@csrf @method('PUT') {{-- Without JavaScript all sections remain visible and the unused tab controls stay hidden. --}}

{{ __('receiver_tabs.details') }}

@foreach ($consentOptions as $value => $label) @endforeach
@include('receiver.partials.nh-fields')
@include('receiver.partials.receiverList') @include('receiver.partials.nh-unsubscribed-memberships')
@foreach (['email', 'sms'] as $statisticsChannel)
@include('receiver.partials.nh-statistics', ['channel' => $statisticsChannel])
@endforeach
{{ __('receiver.form.save') }} {{ __('receiver.form.cancel') }} {{ __('receiver.delete') }}