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

[10.x] Use carbon::now() to get current timestamp in takeUntilTimeout lazycollection-method #47200

Merged

Conversation

gdebrauwer
Copy link
Contributor

When you set the current time to a date in the future using setTestNow carbon method, and your code uses the takeUntilTimeout method on a LazyCollection, then the no items of the lazy collection will be taken, while it should take items.

User::factory()->count(10)->create();

Carbon::setTestNow(now()->addYear());

$users = User::lazy()->takeUntilTimeout(now()->addMinute())->all();
// will be empty while that should not be the case

@taylorotwell taylorotwell merged commit 9475aac into laravel:10.x May 24, 2023
15 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.

None yet

2 participants