Skip to content

Commit

Permalink
Reset array keys for restoration (#35218)
Browse files Browse the repository at this point in the history
  • Loading branch information
driesvints authored Nov 13, 2020
1 parent a5c47f6 commit 851b671
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,8 @@ public function newQueryForRestoration($ids)
*/
protected function newQueryForCollectionRestoration(array $ids)
{
$ids = array_values($ids);

if (! Str::contains($ids[0], ':')) {
return parent::newQueryForRestoration($ids);
}
Expand Down
2 changes: 2 additions & 0 deletions src/Illuminate/Database/Eloquent/Relations/MorphPivot.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ public function newQueryForRestoration($ids)
*/
protected function newQueryForCollectionRestoration(array $ids)
{
$ids = array_values($ids);

if (! Str::contains($ids[0], ':')) {
return parent::newQueryForRestoration($ids);
}
Expand Down

0 comments on commit 851b671

Please sign in to comment.