Skip to content

Commit

Permalink
Merge pull request #199 from howdu/patch-5
Browse files Browse the repository at this point in the history
Fix empty array offset
  • Loading branch information
awcodes authored Jun 5, 2023
2 parents 80eb501 + b798b7c commit 16215f7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Components/Forms/CuratorPicker.php
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,10 @@ public function relationship(string | Closure $relationshipName, string | Closur
});

$this->saveRelationshipsUsing(static function (CuratorPicker $component, Model $record, $state) {
if (blank($state)) {
return;
}

if ($component->isMultiple()) {
$state = Arr::pluck($state,'id');
$component->getRelationship()->sync($state ?? []);
Expand Down

0 comments on commit 16215f7

Please sign in to comment.