From b8af19c91036d9b658911007b8f9f37d760c4d75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Duli=C3=A7i?= Date: Fri, 13 Nov 2020 15:37:46 +0300 Subject: [PATCH] casting enabled attribute --- app/Abstracts/BulkAction.php | 4 ++-- overrides/akaunting/module/Commands/DisableCommand.php | 4 ++-- overrides/akaunting/module/Commands/EnableCommand.php | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Abstracts/BulkAction.php b/app/Abstracts/BulkAction.php index 2493fedbc..a629d0a35 100644 --- a/app/Abstracts/BulkAction.php +++ b/app/Abstracts/BulkAction.php @@ -76,7 +76,7 @@ abstract class BulkAction $items = $this->getSelectedRecords($request); foreach ($items as $item) { - $item->enabled = 1; + $item->enabled = true; $item->save(); } } @@ -93,7 +93,7 @@ abstract class BulkAction $items = $this->getSelectedRecords($request); foreach ($items as $item) { - $item->enabled = 0; + $item->enabled = false; $item->save(); } } diff --git a/overrides/akaunting/module/Commands/DisableCommand.php b/overrides/akaunting/module/Commands/DisableCommand.php index 310449a39..d62d7414b 100644 --- a/overrides/akaunting/module/Commands/DisableCommand.php +++ b/overrides/akaunting/module/Commands/DisableCommand.php @@ -35,7 +35,7 @@ class DisableCommand extends Command return; } - if ($this->model->enabled == 0) { + if (!$this->model->enabled) { $this->comment("Module [{$this->alias}] is already disabled."); return; } @@ -43,7 +43,7 @@ class DisableCommand extends Command $this->changeRuntime(); // Update db - $this->model->enabled = 0; + $this->model->enabled = false; $this->model->save(); $this->createHistory('disabled'); diff --git a/overrides/akaunting/module/Commands/EnableCommand.php b/overrides/akaunting/module/Commands/EnableCommand.php index 51b787d9a..75a7f1510 100644 --- a/overrides/akaunting/module/Commands/EnableCommand.php +++ b/overrides/akaunting/module/Commands/EnableCommand.php @@ -35,7 +35,7 @@ class EnableCommand extends Command return; } - if ($this->model->enabled == 1) { + if ($this->model->enabled) { $this->comment("Module [{$this->alias}] is already enabled."); return; } @@ -43,7 +43,7 @@ class EnableCommand extends Command $this->changeRuntime(); // Update db - $this->model->enabled = 1; + $this->model->enabled = true; $this->model->save(); $this->createHistory('enabled');