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', 'created_from' => source_name(), 'created_by' => user_id(), ]); $this->createHistory('installed'); event(new Installed($this->alias, $this->company_id, $this->locale)); $this->revertRuntime(); $this->info("Module [{$this->alias}] installed!"); } }