Back

If you ever want to remove the value that you used in a groupBy() on a collection. This could be useful (or at least it was for me).

$collection->map(fn ($items) => (
collect($items)->map(fn ($item) => (
collect($item)->forget($KEY_TO_REMOVE))
)
))

158

  • No matching results...
  • Searching...

/ 1000