The
Read more in the official Laravel docs.
mapWithKeys method iterates through the collection and passes each value to the given callback. The callback should return an associative array containing a single key / value pair.Read more in the official Laravel docs.