Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.x] Add method filterNulls() to Arr #39921

Merged
merged 5 commits into from Dec 7, 2021
Merged

Conversation

chu121su12
Copy link
Contributor

This PR adds array helper to filter array from nulls, compared to base array_filter which filters on falsy values.

@chu121su12 chu121su12 marked this pull request as draft December 7, 2021 11:38
@chu121su12 chu121su12 marked this pull request as ready for review December 7, 2021 11:41
@JurianArie
Copy link
Contributor

Collections have a method called whereNotNull https://laravel.com/docs/8.x/collections#method-wherenotnull. Maybe it should be named the same here?

@chu121su12
Copy link
Contributor Author

I’m open to name change, however changing to whereX may lead to implied dynamic parameter support based on operatorForWhere.

Personally I think more advanced where uses is reserved for collection instead of arr.

@taylorotwell taylorotwell merged commit c16367a into laravel:8.x Dec 7, 2021
@chu121su12 chu121su12 deleted the filter-null branch December 7, 2021 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants