set company id
This commit is contained in:
parent
e3730ed6dd
commit
c809e94763
@ -31,17 +31,21 @@ class ModuleInstall extends Command
|
|||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
|
$alias = $this->argument('alias');
|
||||||
|
$company_id = $this->argument('company_id');
|
||||||
|
|
||||||
|
// Set company id
|
||||||
|
session(['company_id' => $company_id]);
|
||||||
|
|
||||||
$request = [
|
$request = [
|
||||||
'company_id' => $this->argument('company_id'),
|
'company_id' => $company_id,
|
||||||
'alias' => strtolower($this->argument('alias')),
|
'alias' => strtolower($alias),
|
||||||
'status' => '1',
|
'status' => '1',
|
||||||
];
|
];
|
||||||
|
|
||||||
$model = Module::create($request);
|
$model = Module::create($request);
|
||||||
|
|
||||||
$module = $this->laravel['modules']->findByAlias($model->alias);
|
$module = $this->laravel['modules']->findByAlias($alias);
|
||||||
|
|
||||||
$company_id = $this->argument('company_id');
|
|
||||||
|
|
||||||
// Add history
|
// Add history
|
||||||
$data = [
|
$data = [
|
||||||
@ -61,7 +65,10 @@ class ModuleInstall extends Command
|
|||||||
$this->call('migrate', ['--force' => true]);
|
$this->call('migrate', ['--force' => true]);
|
||||||
|
|
||||||
// Trigger event
|
// Trigger event
|
||||||
event(new ModuleInstalled($model->alias, $company_id));
|
event(new ModuleInstalled($alias, $company_id));
|
||||||
|
|
||||||
|
// Unset company id
|
||||||
|
session()->forget('company_id');
|
||||||
|
|
||||||
$this->info('Module installed!');
|
$this->info('Module installed!');
|
||||||
}
|
}
|
||||||
|
@ -286,8 +286,6 @@ class Item extends Controller
|
|||||||
* Final actions post update.
|
* Final actions post update.
|
||||||
*
|
*
|
||||||
* @param $alias
|
* @param $alias
|
||||||
* @param $old
|
|
||||||
* @param $new
|
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function post($alias)
|
public function post($alias)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user