fixed signature #350
This commit is contained in:
parent
0bcb5e606f
commit
b894daff29
@ -10,11 +10,11 @@ use Symfony\Component\Console\Input\InputArgument;
|
|||||||
class ModuleDisable extends Command
|
class ModuleDisable extends Command
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* The console command name.
|
* The name and signature of the console command.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $name = 'module:disable {alias} {company_id}';
|
protected $signature = 'module:disable {alias} {company_id}';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The console command description.
|
* The console command description.
|
||||||
@ -25,21 +25,23 @@ class ModuleDisable extends Command
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Execute the console command.
|
* Execute the console command.
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
$alias = $this->argument('alias');
|
$alias = $this->argument('alias');
|
||||||
$company_id = $this->argument('company_id');
|
$company_id = $this->argument('company_id');
|
||||||
|
|
||||||
$model = Module::alias($alias)->companyId($company_id)->get();
|
$model = Module::alias($alias)->companyId($company_id)->first();
|
||||||
|
|
||||||
if (!$model) {
|
if (!$model) {
|
||||||
$this->info("Module [{$alias}] not found.");
|
$this->info("Module [{$alias}] not found.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($model->enabled == 1) {
|
if ($model->status == 1) {
|
||||||
$model->enabled = 0;
|
$model->status = 0;
|
||||||
$model->save();
|
$model->save();
|
||||||
|
|
||||||
$module = $this->laravel['modules']->findByAlias($alias);
|
$module = $this->laravel['modules']->findByAlias($alias);
|
||||||
|
@ -10,11 +10,11 @@ use Symfony\Component\Console\Input\InputArgument;
|
|||||||
class ModuleEnable extends Command
|
class ModuleEnable extends Command
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* The console command name.
|
* The name and signature of the console command.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $name = 'module:enable {alias} {company_id}';
|
protected $signature = 'module:enable {alias} {company_id}';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The console command description.
|
* The console command description.
|
||||||
@ -25,21 +25,23 @@ class ModuleEnable extends Command
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Execute the console command.
|
* Execute the console command.
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
$alias = $this->argument('alias');
|
$alias = $this->argument('alias');
|
||||||
$company_id = $this->argument('company_id');
|
$company_id = $this->argument('company_id');
|
||||||
|
|
||||||
$model = Module::alias($alias)->companyId($company_id)->get();
|
$model = Module::alias($alias)->companyId($company_id)->first();
|
||||||
|
|
||||||
if (!$model) {
|
if (!$model) {
|
||||||
$this->info("Module [{$alias}] not found.");
|
$this->info("Module [{$alias}] not found.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($model->enabled == 0) {
|
if ($model->status == 0) {
|
||||||
$model->enabled = 1;
|
$model->status = 1;
|
||||||
$model->save();
|
$model->save();
|
||||||
|
|
||||||
$module = $this->laravel['modules']->findByAlias($alias);
|
$module = $this->laravel['modules']->findByAlias($alias);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user