Laravel Collection Concat Method Example

$collecton->concat(Array OR Collection);

Laravel Collection concat() Example

public function index(){$collectionA = collect(["One"]);$collectionB = collect(["Two"]);$collectionC = collect(["Three"]);$collection = $collectionA->concat($collectionB)->concat($collectionC);dd($collection);}
Illuminate\Support\Collection Object([items:protected] => Array([0] => One[1] => Two[2] => Three))

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store