Answer the question
In order to leave comments, you need to log in
How to merge collections in Laravel 5?
Hello. Apparently, the balls for the rollers have already stopped by, I just can’t think of how to merge the collections. In foreach I sort through users from which I take away certain objects, through hasMany. I get the following 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 ▶}
]
}
Collection {#699 ▼
#items: array:4 [▼
0 => PitSold {#693 ▶}
1 => PitSold {#700 ▶}
2 => PitSold {#704 ▶}
3 => PitSold {#705 ▶}
]
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question