Skip to content

Commit

Permalink
Fixed excluded columns
Browse files Browse the repository at this point in the history
  • Loading branch information
jzaplet committed Jun 14, 2024
1 parent 3938660 commit 1d6bead
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Http/Request/Collection/Form/UpdatingFormRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ public function process(array $data): Response

// Format one-to-many data
foreach ($schema->getOneToManyColumns() as $column) {
$row[$column['name']] = array_map(fn($item) => $item['id'], $row[$column['name']]);
if (array_key_exists($column['name'], $row)) {
$row[$column['name']] = array_map(fn($item) => $item['id'], $row[$column['name']]);
}
}

// Format many-to-one data
Expand All @@ -100,7 +102,9 @@ public function process(array $data): Response

// Format-many-to-many data
foreach ($schema->getManyToManyColumns() as $column) {
$row[$column['name']] = array_map(fn($item) => $item['id'], $row[$column['name']]);
if (array_key_exists($column['name'], $row)) {
$row[$column['name']] = array_map(fn($item) => $item['id'], $row[$column['name']]);
}
}

/** @var string $rowId */
Expand Down

0 comments on commit 1d6bead

Please sign in to comment.