prepare(); if ($this->getModel()) { $this->comment("Module [{$this->alias}] is already installed."); return; } $this->changeRuntime(); // Create db $this->model = Model::create([ 'company_id' => $this->company_id, 'alias' => $this->alias, 'enabled' => '1', ]); $this->createHistory('installed'); event(new Installed($this->alias, $this->company_id)); $this->revertRuntime(); $this->info("Module [{$this->alias}] installed!"); } }