authorize('customers.manage'); $template = MailTemplate::query()->where('uuid', $uuid)->firstOrFail(); $this->uuid = $uuid; $this->name = $template->name; $this->subject = $template->subject; $this->body = $template->body; $this->active = (bool) $template->active; } public function save() { $this->authorize('customers.manage'); $data = $this->validate(); MailTemplate::query()->where('uuid', $this->uuid)->update([ 'name' => trim($data['name']), 'subject' => trim($data['subject']), 'body' => $data['body'], 'active' => $this->active, ]); $this->dispatch('notify', message: __('templates.saved')); return $this->redirectRoute('admin.templates', navigate: true); } public function render() { return view('livewire.admin.edit-mail-template', [ 'placeholders' => MailTemplateRenderer::PLACEHOLDERS, ]); } }