Skip to content

[12.x] Clarify the behavior of head and last helpers #10614

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

Merged

Conversation

AhmedAlaa4611
Copy link
Contributor

Description

This PR clarifies the behavior of the head() and last() helpers when used on an empty array. It helps developers understand that the method will return false in such cases, which might not be immediately obvious.

Note

I used the same tone that we have used elsewhere in the docs.

@taylorotwell taylorotwell merged commit 0a19df6 into laravel:12.x Jul 15, 2025
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