canOrAbort('create perfume feature'); $this->form->store(); $this->dispatch('refreshDatatable'); $this->toast('Keunggulan parfum berhasil ditambahkan.'); Flux::modals()->close(); } public function update(): void { $this->canOrAbort('update perfume feature'); $this->form->update(); $this->dispatch('refreshDatatable'); $this->toast('Keunggulan parfum berhasil diperbarui.'); Flux::modals()->close(); } public function delete(PerfumeFeatureModel $perfumeFeature): void { $this->canOrAbort('delete perfume feature'); $this->form->perfumeFeature = $perfumeFeature; $this->form->delete(); $this->dispatch('refreshDatatable'); $this->toast('Keunggulan parfum berhasil dihapus.'); Flux::modals()->close(); } #[On('fn:sortOrder')] public function sortOrder(PerfumeFeatureModel $perfumeFeature, string $direction): void { $this->canOrAbort('update perfume feature'); $this->form->perfumeFeature = $perfumeFeature; $this->form->sortOrder($direction); $this->dispatch('refreshDatatable'); } #[On('modal:open')] public function openModal(string $method, string $modalTitle, ?string $id = null): void { $this->resetValidation(); $this->resetErrorBag(); $this->method = $method; $this->modalTitle = $modalTitle; if ($id) { $this->form->setPerfumeFeature(PerfumeFeatureModel::byHashOrFail($id)); } } public function render(): View { return view('livewire.studio.feature.perfume-features', [ 'pageTitle' => 'Keunggulan Parfum', ]); } }