Palzin Track
Get 15% off with code PTRACKSIGNUP15 

Laravel Diary Logo

Laravel Array Helper Function: array_collapse

The collapse helper method in Laravel accepts an array as its parameter and returns a new array with the contents of all the nested arrays. The method is not recursive, meaning it only collapses the top-level arrays. There is also a global function called array_collapse which is a shortcut to calling Arr::collapse.