Skip to content

[10.x] Arr::select not working when $keys is a string - #50169

Merged
taylorotwell merged 2 commits into
laravel:10.xfrom
Sicklou:patch-1
Feb 21, 2024
Merged

[10.x] Arr::select not working when $keys is a string#50169
taylorotwell merged 2 commits into
laravel:10.xfrom
Sicklou:patch-1

Conversation

@Sicklou

@Sicklou Sicklou commented Feb 20, 2024

Copy link
Copy Markdown
Contributor

Adding a check about $keys as a string.

If it is a string, transform it into an array.

Function documentation says string is a valid type for $keys

Adding a check about $keys type.

If it is a string, transform it into an array.

If not, it throws a foreach() error
@ahinkle

ahinkle commented Feb 21, 2024

Copy link
Copy Markdown
Contributor

Needs tests. 👍

@GrahamCampbell GrahamCampbell changed the title Arr::select not working when $keys is a string [10.x] Arr::select not working when $keys is a string Feb 21, 2024
@taylorotwell
taylorotwell merged commit e708043 into laravel:10.x Feb 21, 2024
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.

3 participants