laravel collection concat

Solutions on MaxInterview for laravel collection concat by the best coders in the world

showing results for - "laravel collection concat"
Martina
14 Jan 2018
1$collection = collect(['John Doe']);
2
3$concatenated = $collection->concat(['Jane Doe'])->concat(['name' => 'Johnny Doe']);
4
5$concatenated->all();
6
7// ['John Doe', 'Jane Doe', 'Johnny Doe']