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)); }); }