Is it possible to use some neat Laravel collection method similar to forget()
, that will work with nested arrays.
Here is an example of what I want.
I have such a Collection
instance:
And I want to drop coordinates
column (all items are identical) in a similar way to
$cities->forget('cities', 2) // (second parameter is not real, it's a "nested level" and I took it from my head as example of what I want)
As an answer I'd like to receive some existing Collection
method or a Collection
macro, that will work in one line.
All other "more than one line options" with unset()
and map()
won't be better, than what I have now :)