Laravel Collection Public API: flatten
The flatten method in Laravel's Collection class allows you to transform a nested collection into a single-dimensional collection. This method does not preserve any keys from the original collection, even for deeply nested arrays.