Skip to content

Commit 0c6ebdb

Browse files
committed
Fix: save() should always accepts ['touch' => false]
1 parent ebb3e88 commit 0c6ebdb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -672,11 +672,11 @@ public function createOrFirst(array $attributes = [], array $values = [], array
672672
*/
673673
public function updateOrCreate(array $attributes, array $values = [], array $joining = [], $touch = true)
674674
{
675-
return tap($this->firstOrCreate($attributes, $values, $joining, $touch), function ($instance) use ($values, $touch) {
675+
return tap($this->firstOrCreate($attributes, $values, $joining, $touch), function ($instance) use ($values) {
676676
if (! $instance->wasRecentlyCreated) {
677677
$instance->fill($values);
678678

679-
$instance->save(compact('touch'));
679+
$instance->save(['touch' => false]);
680680
}
681681
});
682682
}

0 commit comments

Comments
 (0)