From 184a93f04678320e3dac2cdbdf0b2e403a21d606 Mon Sep 17 00:00:00 2001 From: Igor Malyuk Date: Tue, 28 Mar 2017 18:37:16 +0300 Subject: [PATCH] Update InteractsWithPivotTable.php Type for result of parseIds method. When using sync method and passing only one eloquent model as first argument Fatal error is thrown, because formatRecordsList accepts only arrays, but result of parseIds method is not casted to type like in (for example) in toggle method. --- .../Eloquent/Relations/Concerns/InteractsWithPivotTable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php b/src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php index 98180a7af6a8..7e79bc17bb24 100644 --- a/src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php +++ b/src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php @@ -93,7 +93,7 @@ public function sync($ids, $detaching = true) )->all(); $detach = array_diff($current, array_keys( - $records = $this->formatRecordsList($this->parseIds($ids)) + $records = $this->formatRecordsList((array) $this->parseIds($ids)) )); // Next, we will take the differences of the currents and given IDs and detach