How to merge collections in Laravel 5?

Hello. Probably already balls for rollers came can't think how to drain the collection. In the foreach enumerates the users who have taken certain objects using hasMany. Get a list of collections (from 2 users):

Collection {#683 ▼
 #items: array:1 [▼
 0 => PitSold {#693 ▶}
]
}
Collection {#699 ▼
 #items: array:3 [▼
 0 => PitSold {#700 ▶}
 1 => PitSold {#704 ▶}
 2 => PitSold {#705 ▶}
]
}


How may I obtain a single collection with all elements:
Collection {#699 ▼
 #items: array:4 [▼
 0 => PitSold {#693 ▶}
 1 => PitSold {#700 ▶}
 2 => PitSold {#704 ▶}
 3 => PitSold {#705 ▶}
]
}
July 8th 19 at 16:33
2 answers
July 8th 19 at 16:35
Like myself found the solution:
$collection->flatten();
July 8th 19 at 16:37
Isplsi map

Find more questions by tags LaravelPHP