Skip to content
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

add clarification about forget method return value #9982

Merged

Conversation

browner12
Copy link
Contributor

the wording here is just a little unclear. the first sentence seems to suggest that the forget() method does not return anything, even though it does.

you are free to assign the result to a new variable even though you don't need to (and maybe shouldn't?)

$collection = collect(['name' => 'taylor', 'framework' => 'laravel']);
 
$newCollection = $collection->forget('name');

dump($collection === $newCollection); // true

the wording here is just a little unclear. the first sentence seems to suggest that the `forget()` method does not return anything, even though it does.

you are free to assign the result to a new variable even though you don't need to.
@taylorotwell taylorotwell merged commit 426c628 into laravel:11.x Oct 23, 2024
@browner12 browner12 deleted the AB-collection-forget-clarification branch October 23, 2024 14:27
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