diff --git a/app/Console/Commands/ModuleInstall.php b/app/Console/Commands/ModuleInstall.php index ee2528627..4e279a217 100644 --- a/app/Console/Commands/ModuleInstall.php +++ b/app/Console/Commands/ModuleInstall.php @@ -41,9 +41,11 @@ class ModuleInstall extends Command $module = LaravelModule::findByAlias($model->alias); + $company_id = $this->argument('company_id'); + // Add history $data = [ - 'company_id' => $this->argument('company_id'), + 'company_id' => $company_id, 'module_id' => $model->id, 'category' => $module->get('category'), 'version' => $module->get('version'), @@ -56,7 +58,7 @@ class ModuleInstall extends Command $this->call('migrate', ['--force' => true]); // Trigger event - event(new ModuleInstalled($model->alias)); + event(new ModuleInstalled($model->alias, $company_id)); $this->info('Module installed!'); } diff --git a/app/Events/ModuleInstalled.php b/app/Events/ModuleInstalled.php index 7846ecd91..b581eb539 100644 --- a/app/Events/ModuleInstalled.php +++ b/app/Events/ModuleInstalled.php @@ -6,13 +6,17 @@ class ModuleInstalled { public $alias; + public $company_id; + /** * Create a new event instance. * * @param $alias + * @param $company_id */ - public function __construct($alias) + public function __construct($alias, $company_id) { $this->alias = $alias; + $this->company_id = $company_id; } } \ No newline at end of file