Skip to content
This repository was archived by the owner on Sep 22, 2024. It is now read-only.

Commit ad3fb27

Browse files
committed
Parse id in case it's a model
1 parent 70fc20e commit ad3fb27

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/BelongsToMany.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class BelongsToMany extends BaseBelongsToMany
1717
public function attach($id, array $attributes = [], $touch = true)
1818
{
1919
$this->parent->setPivotChanges('attach', $this->getRelationName(), [
20-
$id => $attributes,
20+
$this->parseId($id) => $attributes,
2121
]);
2222

2323
if ($this->parent->firePivotAttachingEvent() === false) {
@@ -74,7 +74,7 @@ public function detach($ids = null, $touch = true)
7474
public function updateExistingPivot($id, array $attributes, $touch = true)
7575
{
7676
$this->parent->setPivotChanges('update', $this->getRelationName(), [
77-
$id => $attributes,
77+
$this->parseId($id) => $attributes,
7878
]);
7979

8080
if ($this->parent->firePivotUpdatingEvent() === false) {

0 commit comments

Comments
 (0)