Skip to content

Conversation

@rafaelqueiroz
Copy link
Contributor

@rafaelqueiroz rafaelqueiroz commented Oct 29, 2025

From #54910

@rafaelqueiroz rafaelqueiroz marked this pull request as draft October 29, 2025 12:02
@rodrigopedra
Copy link
Contributor

Using Arr::exists won't work with a collection of objects that don't implement ArrayAccess.

On my comment on the previous PR, I suggested using fn($v) => filled(data_get($v, $key)), but that also won't work for the case where the key is present but its value is null.

Ideally the test closure would replicate the data_get() helper function logic to verify if the key is present, also with nested properties using dot notation.

Maybe adding a data_has() helper with the logic to verify if a key is present could be a good idea.

Sorry for the formatting, am typing from my phone.

@rafaelqueiroz rafaelqueiroz marked this pull request as ready for review October 29, 2025 13:38
@rafaelqueiroz rafaelqueiroz changed the title [12.x] EnumerateValues::value() support and return negative values if exists [12.x] EnumerateValues::value() support collection Oct 29, 2025
@rafaelqueiroz rafaelqueiroz changed the title [12.x] EnumerateValues::value() support collection [12.x] EnumerateValues::value() support objects Oct 29, 2025
@taylorotwell
Copy link
Member

Reverting original PR for now, which gives this one conflicts.

@taylorotwell taylorotwell marked this pull request as draft October 29, 2025 14:20
@rafaelqueiroz rafaelqueiroz marked this pull request as ready for review October 29, 2025 15:05
@rafaelqueiroz rafaelqueiroz changed the title [12.x] EnumerateValues::value() support objects [12.x] EnumerateValues::value() support objects and return negative values Oct 29, 2025
@taylorotwell taylorotwell merged commit af8f509 into laravel:12.x Oct 29, 2025
66 checks passed
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