The
Read more in the official Laravel docs.
map method iterates through the collection and passes each value to the given callback. The callback is free to modify the item and return it, thus forming a new collection of modified items.Read more in the official Laravel docs.