Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgergo committed Oct 20, 2023
1 parent af46240 commit 2637893
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Fields/Boolean.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

/**
Expand Down
8 changes: 4 additions & 4 deletions src/Fields/Fieldset.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
});
}

Expand All @@ -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));
});
}

Expand Down

0 comments on commit 2637893

Please sign in to comment.