Skip to content

Commit f0c7bb7

Browse files
committed
Separate fields and modelId for creating value for Observers
1 parent 5b39bff commit f0c7bb7

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/NovaInlineRelationship.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,8 +515,11 @@ protected function updateFieldValue($resource, $attribute, Collection $propertie
515515
*/
516516
protected function getResourceResponse(NovaRequest $request, $response, Collection $properties): array
517517
{
518-
return collect($response)->map(function ($item) use ($properties, $request) {
519-
return collect($item)->map(function ($value, $key) use ($properties, $request, $item) {
518+
return collect($response)->map(function ($itemData, $weight) use ($properties, $request) {
519+
$item = $itemData['values'];
520+
$modelId = $itemData['modelId'];
521+
522+
$fields = collect($item)->map(function ($value, $key) use ($properties, $request, $item) {
520523
if ($properties->has($key)) {
521524
$field = $this->getResourceField($properties->get($key), $key);
522525
$newRequest = $this->getDuplicateRequest($request, $item);

0 commit comments

Comments
 (0)