Skip to content

Conversation

@hebinet
Copy link
Contributor

@hebinet hebinet commented Apr 10, 2021

This PR changes the value argument type to iterable in Illuminate\Database\Query\Builder->whereBetween() method.

This enables the usage of every iterable like CarbonPeriod or Collection to be used as $value argument.

Usage

$period = now()->toPeriod(now()->addDay());

User::whereBetween('created_at', $period)->get();

// or

User::whereBetween('id', collect([1,2]))->get();

@hebinet hebinet changed the title [9.x] CarbonPeriod value type for whereBetween [9.x] Iterable value type for whereBetween Apr 10, 2021
@taylorotwell taylorotwell merged commit f7cd47a into laravel:master Apr 11, 2021
@hebinet hebinet deleted the carbon-period-in-where-between branch April 11, 2021 17:19
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