Skip to content

Commit

Permalink
styling #350
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdulici committed May 21, 2018
1 parent 243d7ed commit c877560
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 72 deletions.
68 changes: 34 additions & 34 deletions app/Console/Commands/ModuleDisable.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,50 +10,50 @@
class ModuleDisable extends Command
{
/**
* The console command name.
*
* @var string
*/
* The console command name.
*
* @var string
*/
protected $name = 'module:disable {alias} {company_id}';

/**
* The console command description.
*
* @var string
*/
* The console command description.
*
* @var string
*/
protected $description = 'Disable the specified module.';

/**
* Execute the console command.
*/
* Execute the console command.
*/
public function handle()
{
$alias = $this->argument('alias');
$company_id = $this->argument('company_id');
$alias = $this->argument('alias');
$company_id = $this->argument('company_id');

$model = Module::alias($alias)->companyId($company_id)->get();

if (!$model) {
$this->info("Module [{$alias}] not found.");
return;
}
if (!$model) {
$this->info("Module [{$alias}] not found.");
return;
}

if ($model->enabled == 1) {
$model->enabled = 0;
$model->save();

$module = $this->laravel['modules']->findByAlias($alias);

// Add history
$data = [
'company_id' => $company_id,
'module_id' => $model->id,
'category' => $module->get('category'),
'version' => $module->get('version'),
'description' => trans('modules.disabled', ['module' => $module->get('name')]),
];

ModuleHistory::create($data);
$module = $this->laravel['modules']->findByAlias($alias);

// Add history
$data = [
'company_id' => $company_id,
'module_id' => $model->id,
'category' => $module->get('category'),
'version' => $module->get('version'),
'description' => trans('modules.disabled', ['module' => $module->get('name')]),
];

ModuleHistory::create($data);

$this->info("Module [{$alias}] disabled.");
} else {
Expand All @@ -62,10 +62,10 @@ public function handle()
}

/**
* Get the console command arguments.
*
* @return array
*/
* Get the console command arguments.
*
* @return array
*/
protected function getArguments()
{
return array(
Expand Down
68 changes: 34 additions & 34 deletions app/Console/Commands/ModuleEnable.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,50 +10,50 @@
class ModuleEnable extends Command
{
/**
* The console command name.
*
* @var string
*/
* The console command name.
*
* @var string
*/
protected $name = 'module:enable {alias} {company_id}';

/**
* The console command description.
*
* @var string
*/
* The console command description.
*
* @var string
*/
protected $description = 'Enable the specified module.';

/**
* Execute the console command.
*/
* Execute the console command.
*/
public function handle()
{
$alias = $this->argument('alias');
$company_id = $this->argument('company_id');
$alias = $this->argument('alias');
$company_id = $this->argument('company_id');

$model = Module::alias($alias)->companyId($company_id)->get();

if (!$model) {
$this->info("Module [{$alias}] not found.");
return;
}
if (!$model) {
$this->info("Module [{$alias}] not found.");
return;
}

if ($model->enabled == 0) {
$model->enabled = 1;
$model->save();

$module = $this->laravel['modules']->findByAlias($alias);

// Add history
$data = [
'company_id' => $company_id,
'module_id' => $model->id,
'category' => $module->get('category'),
'version' => $module->get('version'),
'description' => trans('modules.enabled', ['module' => $module->get('name')]),
];

ModuleHistory::create($data);
$module = $this->laravel['modules']->findByAlias($alias);

// Add history
$data = [
'company_id' => $company_id,
'module_id' => $model->id,
'category' => $module->get('category'),
'version' => $module->get('version'),
'description' => trans('modules.enabled', ['module' => $module->get('name')]),
];

ModuleHistory::create($data);

$this->info("Module [{$alias}] enabled.");
} else {
Expand All @@ -62,10 +62,10 @@ public function handle()
}

/**
* Get the console command arguments.
*
* @return array
*/
* Get the console command arguments.
*
* @return array
*/
protected function getArguments()
{
return array(
Expand Down
8 changes: 4 additions & 4 deletions app/Console/Commands/ModuleInstall.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ public function handle()
}

/**
* Get the console command arguments.
*
* @return array
*/
* Get the console command arguments.
*
* @return array
*/
protected function getArguments()
{
return array(
Expand Down

0 comments on commit c877560

Please sign in to comment.