This commit is contained in:
Denis Duliçi
2018-05-21 18:10:43 +03:00
parent c57f3936ca
commit 243d7edaf6
4 changed files with 170 additions and 3 deletions

@ -6,7 +6,7 @@ use App\Events\ModuleInstalled;
use App\Models\Module\Module;
use App\Models\Module\ModuleHistory;
use Illuminate\Console\Command;
use Module as LaravelModule;
use Symfony\Component\Console\Input\InputArgument;
class ModuleInstall extends Command
{
@ -39,7 +39,7 @@ class ModuleInstall extends Command
$model = Module::create($request);
$module = LaravelModule::findByAlias($model->alias);
$module = $this->laravel['modules']->findByAlias($model->alias);
$company_id = $this->argument('company_id');
@ -49,7 +49,7 @@ class ModuleInstall extends Command
'module_id' => $model->id,
'category' => $module->get('category'),
'version' => $module->get('version'),
'description' => trans('modules.history.installed', ['module' => $module->get('name')]),
'description' => trans('modules.installed', ['module' => $module->get('name')]),
];
ModuleHistory::create($data);
@ -62,4 +62,17 @@ class ModuleInstall extends Command
$this->info('Module installed!');
}
/**
* Get the console command arguments.
*
* @return array
*/
protected function getArguments()
{
return array(
array('alias', InputArgument::REQUIRED, 'Module alias.'),
array('company_id', InputArgument::REQUIRED, 'Company ID.'),
);
}
}