@@ -85,11 +85,11 @@ protected function setWhere()
85
85
}
86
86
87
87
/** @inheritdoc */
88
- public function save (Model $ model , array $ joining = [], $ touch = true )
88
+ public function save (Model $ model , array $ pivotAttributes = [], $ touch = true )
89
89
{
90
90
$ model ->save (['touch ' => false ]);
91
91
92
- $ this ->attach ($ model , $ joining , $ touch );
92
+ $ this ->attach ($ model , $ pivotAttributes , $ touch );
93
93
94
94
return $ model ;
95
95
}
@@ -272,12 +272,13 @@ public function detach($ids = [], $touch = true)
272
272
// Remove the relation from the parent.
273
273
$ data = [];
274
274
foreach ($ ids as $ item ) {
275
- $ data = array_merge ($ data , [
275
+ $ data = [
276
+ ...$ data ,
276
277
[
277
278
$ this ->relatedPivotKey => $ item ,
278
- $ this ->morphType => $ this ->related ->getMorphClass (),
279
+ $ this ->morphType => $ this ->related ->getMorphClass (),
279
280
],
280
- ]) ;
281
+ ];
281
282
}
282
283
283
284
$ this ->parent ->pull ($ this ->table , $ data );
@@ -378,8 +379,8 @@ protected function whereInMethod(Model $model, $key)
378
379
/**
379
380
* Extract ids from given pivot table data
380
381
*
381
- * @param array $data
382
- * @param string|null $relatedPivotKey
382
+ * @param array $data
383
+ * @param string|null $relatedPivotKey
383
384
*
384
385
* @return mixed
385
386
*/
0 commit comments