Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgergo committed Oct 25, 2023
1 parent 8a60a38 commit 6924573
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/Fields/BelongsToMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public function resolveHydrate(Request $request, Model $model, mixed $value): vo

$results = $this->resolveRelatableQuery($request, $model)
->findMany(array_keys($value))
->each(function (Model $related) use ($relation, $value): void {
->each(static function (Model $related) use ($relation, $value): void {
$related->setRelation(
$relation->getPivotAccessor(),
$relation->newPivot($value[$related->getKey()])
Expand Down
12 changes: 3 additions & 9 deletions src/Fields/Meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ public function as(string $field, Closure $callback = null): static
call_user_func_array($callback, [$this->field]);
}

$this->field->value(fn (Request $request): mixed => $this->resolveValue($request));
$this->field->value(function (Request $request, Model $model): mixed {
return $this->resolveValue($request, $model);
});

return $this;
}
Expand Down Expand Up @@ -240,14 +242,6 @@ public function resolveHydrate(Request $request, Model $model, mixed $value): vo
parent::resolveHydrate($request, $model, $value);
}

/**
* {@inheritdoc}
*/
public function render(): View
{
return $this->field->render();
}

/**
* {@inheritdoc}
*/
Expand Down

0 comments on commit 6924573

Please sign in to comment.