diff --git a/src/Http/Request/Collection/Form/UpdatingFormRequest.php b/src/Http/Request/Collection/Form/UpdatingFormRequest.php index fe5149c..be712b1 100644 --- a/src/Http/Request/Collection/Form/UpdatingFormRequest.php +++ b/src/Http/Request/Collection/Form/UpdatingFormRequest.php @@ -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 @@ -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 */