From 26378935a328fbdab8085f8519c57ef35450edd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=2E=20Nagy=20Gerg=C5=91?= Date: Fri, 20 Oct 2023 13:51:16 +0200 Subject: [PATCH] fixes --- src/Fields/Boolean.php | 2 +- src/Fields/Fieldset.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Fields/Boolean.php b/src/Fields/Boolean.php index 7fe4b5e4..91ceac61 100644 --- a/src/Fields/Boolean.php +++ b/src/Fields/Boolean.php @@ -27,7 +27,7 @@ public function __construct(string $label, string $modelAttribute = null) */ public function getValueForHydrate(Request $request): mixed { - return $request->boolean([$this->getRequestKey()]); + return $request->boolean($this->getRequestKey()); } /** diff --git a/src/Fields/Fieldset.php b/src/Fields/Fieldset.php index 694be62d..59b105f5 100644 --- a/src/Fields/Fieldset.php +++ b/src/Fields/Fieldset.php @@ -31,8 +31,8 @@ protected function resolveField(Request $request, Field $field): void */ public function persist(Request $request, Model $model, mixed $value): void { - $this->resolveFields($request)->each(static function (Field $field) use ($request): void { - $field->persist($request, $field->getValueForHydrate($request)); + $this->resolveFields($request)->each(static function (Field $field) use ($request, $model): void { + $field->persist($request, $model, $field->getValueForHydrate($request)); }); } @@ -41,8 +41,8 @@ public function persist(Request $request, Model $model, mixed $value): void */ public function resolveHydrate(Request $request, Model $model, mixed $value): void { - $this->resolveFields($request)->each(static function (Field $field) use ($request): void { - $field->resolveHydrate($request, $field->getValueForHydrate($request)); + $this->resolveFields($request)->each(static function (Field $field) use ($request, $model): void { + $field->resolveHydrate($request, $model, $field->getValueForHydrate($request)); }); }