action === '') { app($this->model)->where($this->keyName, $id)->delete(); } else { $model = app($this->model)->where($this->keyName, $id)->first(); app($this->action)->execute($model); } $this->dispatch('delete-data-completed'); } catch (Exception $e) { $this->dispatch('delete-data-failed', message: $e->getMessage()); } } }; ?>