Laravel Collection Public API: flatMap
flatMap(callable $callback) The flatMap method is used in the same way as the map (discussed in the Laravel Collection Public API: map article) method but will collapse the resulting collection. The following two code examples are equivalent: 1...