File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -393,15 +393,17 @@ protected function whereInMethod(Model $model, $key)
393
393
*
394
394
* @return mixed
395
395
*/
396
- private function extractIds (array $ data , ?string $ relatedPivotKey = null )
396
+ public function extractIds (array $ data , ?string $ relatedPivotKey = null )
397
397
{
398
398
$ relatedPivotKey = $ relatedPivotKey ?: $ this ->relatedPivotKey ;
399
- return array_reduce ($ data , function ($ carry , $ item ) use ($ relatedPivotKey ) {
399
+ $ result = array_reduce ($ data , function ($ carry , $ item ) use ($ relatedPivotKey ) {
400
400
if (is_array ($ item ) && array_key_exists ($ relatedPivotKey , $ item )) {
401
401
$ carry [] = $ item [$ relatedPivotKey ];
402
402
}
403
403
404
404
return $ carry ;
405
405
}, []);
406
+
407
+ return array_values (array_unique ($ result ));
406
408
}
407
409
}
You can’t perform that action at this time.
0 commit comments