From 40b211405dddb73c9bf61f715aea46779ceecbab Mon Sep 17 00:00:00 2001 From: luanfreitasdev Date: Wed, 20 Sep 2023 17:01:19 -0300 Subject: [PATCH] fix checkbox --- src/Traits/WithCheckbox.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Traits/WithCheckbox.php b/src/Traits/WithCheckbox.php index f4fbeede..7594b310 100644 --- a/src/Traits/WithCheckbox.php +++ b/src/Traits/WithCheckbox.php @@ -44,11 +44,12 @@ public function selectCheckboxAll(): void /** @phpstan-ignore-next-line */ collect($data->items())->each(function (array|Model|\stdClass $model) use ($actionRulesClass) { - $rules = $actionRulesClass->recoverFromAction($model); + $rules = $actionRulesClass->recoverFromAction($model, 'pg:checkbox'); - if (isset($rules['hide']) || isset($rules['disable'])) { + if (filled($rules['hide']) || filled($rules['disable'])) { return; } + $value = $model->{$this->checkboxAttribute}; if (!in_array($value, $this->checkboxValues)) {