Skip to content

[12.x] Support enum values in Collection countBy method#56830

Merged
taylorotwell merged 2 commits into
laravel:12.xfrom
jnoordsij:support-countby-enum
Aug 29, 2025
Merged

[12.x] Support enum values in Collection countBy method#56830
taylorotwell merged 2 commits into
laravel:12.xfrom
jnoordsij:support-countby-enum

Conversation

@jnoordsij

Copy link
Copy Markdown
Contributor

This PR aims to allow usage of enums in the countBy method on Collection classes, by appropriately converting them to strings or ints which can be used as array keys. It also adds some corresponding tests for different method usecases and different enum types.

@jnoordsij jnoordsij force-pushed the support-countby-enum branch from ecfc576 to 03094ab Compare August 29, 2025 18:12
@taylorotwell taylorotwell merged commit d03a367 into laravel:12.x Aug 29, 2025
24 of 63 checks passed
@jnoordsij jnoordsij deleted the support-countby-enum branch August 30, 2025 05:19
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.

2 participants