Skip to content

[7.x] Support Collection#countBy($key) - #33852

Merged
taylorotwell merged 1 commit into
laravel:7.xfrom
JosephSilber:fix/count-by
Aug 13, 2020
Merged

taylorotwell merged 1 commit into
laravel:7.xfrom
JosephSilber:fix/count-by

Conversation

@JosephSilber

@JosephSilber JosephSilber commented Aug 13, 2020 •

Copy link
Copy Markdown
Contributor

#33801 broke the usage of the collection's countBy method when passed a key as a string.

There was obviously no test for it.

This PR fixes it and adds the relevant test.

Closes #33847.

@taylorotwell
taylorotwell merged commit 5682bdb into laravel:7.x Aug 13, 2020
@JosephSilber
JosephSilber deleted the fix/count-by branch August 17, 2020 12:49
salmanarshad321 pushed a commit to salmanarshad321/framework that referenced this pull request Sep 23, 2026
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.

countBy method fails if the field name is passed as a string

4 participants