From 649c8f7d2034e9163e9fb4e765026ad2253731dc Mon Sep 17 00:00:00 2001 From: yaozm Date: Fri, 20 Oct 2023 11:55:31 +0800 Subject: [PATCH] refactor(setting): update Setting.php - Add validation rules for boolean values - Update the saving method --- src/Setting.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Setting.php b/src/Setting.php index 21490c8..4de08a8 100644 --- a/src/Setting.php +++ b/src/Setting.php @@ -30,7 +30,8 @@ public function form(): void }) ->saving(function (int $value): bool { return (bool) $value; - }); + }) + ->rules('required|boolean'); $this->text('length', $this->trans('login-captcha.length')) ->required()