resetValidation(); $this->resetErrorBag(); $this->method = $method; $this->modalTitle = $modalTitle; if ($id) { $this->form->setFaq(FaqModel::byHashOrFail($id)); } } public function create() { $this->canOrAbort('create faq'); $this->form->store(); $this->dispatch('refreshDatatable'); $this->toast('FAQs berhasil ditambahkan.'); Flux::modals()->close(); } public function update() { $this->canOrAbort('update faq'); $this->form->update(); $this->dispatch('refreshDatatable'); $this->toast('FAQs berhasil diperbarui.'); Flux::modals()->close(); } public function delete(FaqModel $faq) { $this->form->faq = $faq; $this->form->delete(); $this->dispatch('refreshDatatable'); $this->toast('FAQs berhasil dihapus.'); Flux::modals()->close(); } #[On('fn:sortOrder')] public function sortOrder(FaqModel $faq, string $direction) { $this->canOrAbort('update faq'); $this->form->faq = $faq; $this->form->sortOrder($direction); $this->dispatch('refreshDatatable'); } public function render() { return view('livewire.studio.manage.faqs', [ 'pageTitle' => 'FAQs', ]); } }