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