added company id to module install event
This commit is contained in:
parent
cec708a4fe
commit
5fb1067f49
@ -41,9 +41,11 @@ class ModuleInstall extends Command
|
|||||||
|
|
||||||
$module = LaravelModule::findByAlias($model->alias);
|
$module = LaravelModule::findByAlias($model->alias);
|
||||||
|
|
||||||
|
$company_id = $this->argument('company_id');
|
||||||
|
|
||||||
// Add history
|
// Add history
|
||||||
$data = [
|
$data = [
|
||||||
'company_id' => $this->argument('company_id'),
|
'company_id' => $company_id,
|
||||||
'module_id' => $model->id,
|
'module_id' => $model->id,
|
||||||
'category' => $module->get('category'),
|
'category' => $module->get('category'),
|
||||||
'version' => $module->get('version'),
|
'version' => $module->get('version'),
|
||||||
@ -56,7 +58,7 @@ class ModuleInstall extends Command
|
|||||||
$this->call('migrate', ['--force' => true]);
|
$this->call('migrate', ['--force' => true]);
|
||||||
|
|
||||||
// Trigger event
|
// Trigger event
|
||||||
event(new ModuleInstalled($model->alias));
|
event(new ModuleInstalled($model->alias, $company_id));
|
||||||
|
|
||||||
$this->info('Module installed!');
|
$this->info('Module installed!');
|
||||||
}
|
}
|
||||||
|
@ -6,13 +6,17 @@ class ModuleInstalled
|
|||||||
{
|
{
|
||||||
public $alias;
|
public $alias;
|
||||||
|
|
||||||
|
public $company_id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new event instance.
|
* Create a new event instance.
|
||||||
*
|
*
|
||||||
* @param $alias
|
* @param $alias
|
||||||
|
* @param $company_id
|
||||||
*/
|
*/
|
||||||
public function __construct($alias)
|
public function __construct($alias, $company_id)
|
||||||
{
|
{
|
||||||
$this->alias = $alias;
|
$this->alias = $alias;
|
||||||
|
$this->company_id = $company_id;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user