Skip to content

Commit 450db70

Browse files
author
paranarimasu
committed
fix: get primary key attribute rather than assuming model uses 'id' - forgot one instance
1 parent da12a6f commit 450db70

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/NestedForm.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ protected function getDetachRequest(NovaRequest $request, $model, $children)
471471
{
472472
return DetachResourceRequest::createFrom($request->replace([
473473
'viaResource' => $this->viaResource,
474-
'viaResourceId' => $model->id,
474+
'viaResourceId' => $model->getKey(),
475475
'viaRelationship' => $this->viaRelationship,
476476
'resources' => $model->{$this->viaRelationship}()->select($this->attribute . '.' . $this->keyName)->whereNotIn($this->attribute . '.' . $this->keyName, $children->pluck($this->keyName))->pluck($this->keyName)
477477
]));

0 commit comments

Comments
 (0)