You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 6, 2019. It is now read-only.
I do not think this is a great idea, as you're now getting a combination of implementation details inside the each method, which I don't think is necessary. The first approach is much nicer and cleaner (aka, as is).
When looping through an array, I always check to ensure the array key exists before calling
Arrays::each
.Example: say I get a POST request that sometimes contains
Input::get('shifts')
. Ifshift
exists, I then want to loop through. Currently, I doImplementing Laravel's
array_get()
and checking forfalse
values insideArrays::each
would allow to shorten the above toand the function
Arrays::each($array, Closure $closure)
can becomeWhat do you think?
The text was updated successfully, but these errors were encountered: