resetValidation(); $this->resetErrorBag(); $this->method = $method; $this->modalTitle = $modalTitle; if ($id) { $this->form->setTier(TierModel::findOrFail($id)); } } public function create() { $this->canOrAbort('create tier'); $this->form->store(); $this->dispatch('refreshDatatable'); $this->toast('Tier berhasil ditambahkan.'); Flux::modals()->close(); } public function update() { $this->canOrAbort('update tier'); $this->form->update(); $this->dispatch('refreshDatatable'); $this->toast('Tier berhasil diperbarui.'); Flux::modals()->close(); } public function delete(TierModel $tier) { $tier->delete(); $this->dispatch('refreshDatatable'); $this->toast('Tier berhasil dihapus.'); Flux::modals()->close(); } public function render() { return view('livewire.studio.loyalty.tiers', [ 'pageTitle' => 'Tier', ]); } }