resetPage(); } } public function with(): array { return [ 'optOuts' => EmailNotificationOptOut::query() ->where('type', EmailNotificationType::Newsletter->value) ->whereHas('user', fn ($query) => $query ->when(trim($this->search) !== '', fn ($inner) => $inner ->where(fn ($match) => $match ->where('name', 'like', '%'.trim($this->search).'%') ->orWhere('email', 'like', '%'.trim($this->search).'%')))) ->with('user:id,name,email,portal,is_active') ->orderByDesc('created_at') ->paginate(50), ]; } }; ?>
{{-- ============== PAGE HEADER ============== --}} {{ __('Zurück') }} {{-- ============== ABMELDUNGEN ============== --}}
{{ __('Abmeldungen') }}
{{ number_format($optOuts->total(), 0, ',', '.') }} {{ __('Einträge') }}
{{ __('User') }} {{ __('E-Mail') }} {{ __('Portal') }} {{ __('Status') }} {{ __('Abgemeldet am') }} @forelse ($optOuts as $optOut) {{ $optOut->user->name }} {{ $optOut->user->email }} {{ $optOut->user->portal?->label() ?? '—' }} @if ($optOut->user->is_active) {{ __('aktiv') }} @else {{ __('inaktiv') }} @endif {{ $optOut->created_at?->format('d.m.Y H:i') ?? '—' }} @empty
{{ trim($search) !== '' ? __('Keine Abmeldungen für diese Suche.') : __('Bislang hat sich niemand vom Newsletter abgemeldet.') }}
@endforelse
@if ($optOuts->hasPages())
{{ $optOuts->links() }}
@endif