authorize('customers.manage'); } public function updatedSearch(): void { $this->resetPage(); } public function render() { $this->authorize('customers.manage'); $mails = SentMail::query() ->with('customer') ->when($this->search !== '', function ($q) { $term = '%'.$this->search.'%'; $q->where(fn ($w) => $w->where('to', 'like', $term)->orWhere('subject', 'like', $term)); }) ->latest('sent_at') ->latest('id') ->paginate(30); return view('livewire.admin.mail-log', ['mails' => $mails]); } }