casting enabled attribute

This commit is contained in:
Denis Duliçi 2020-11-13 15:37:46 +03:00
parent 2d7c18bae5
commit b8af19c910
3 changed files with 6 additions and 6 deletions

View File

@ -76,7 +76,7 @@ abstract class BulkAction
$items = $this->getSelectedRecords($request); $items = $this->getSelectedRecords($request);
foreach ($items as $item) { foreach ($items as $item) {
$item->enabled = 1; $item->enabled = true;
$item->save(); $item->save();
} }
} }
@ -93,7 +93,7 @@ abstract class BulkAction
$items = $this->getSelectedRecords($request); $items = $this->getSelectedRecords($request);
foreach ($items as $item) { foreach ($items as $item) {
$item->enabled = 0; $item->enabled = false;
$item->save(); $item->save();
} }
} }

View File

@ -35,7 +35,7 @@ class DisableCommand extends Command
return; return;
} }
if ($this->model->enabled == 0) { if (!$this->model->enabled) {
$this->comment("Module [{$this->alias}] is already disabled."); $this->comment("Module [{$this->alias}] is already disabled.");
return; return;
} }
@ -43,7 +43,7 @@ class DisableCommand extends Command
$this->changeRuntime(); $this->changeRuntime();
// Update db // Update db
$this->model->enabled = 0; $this->model->enabled = false;
$this->model->save(); $this->model->save();
$this->createHistory('disabled'); $this->createHistory('disabled');

View File

@ -35,7 +35,7 @@ class EnableCommand extends Command
return; return;
} }
if ($this->model->enabled == 1) { if ($this->model->enabled) {
$this->comment("Module [{$this->alias}] is already enabled."); $this->comment("Module [{$this->alias}] is already enabled.");
return; return;
} }
@ -43,7 +43,7 @@ class EnableCommand extends Command
$this->changeRuntime(); $this->changeRuntime();
// Update db // Update db
$this->model->enabled = 1; $this->model->enabled = true;
$this->model->save(); $this->model->save();
$this->createHistory('enabled'); $this->createHistory('enabled');