Laravel Eloquent how to use between operator

$query->whereBetween('age', [$ageFrom, $ageTo]);

Look here: http://laravel.com/docs/4.2/queries#selects

Still holds true for Laravel 5: https://laravel.com/docs/5.8/queries#where-clauses


The whereBetween method verifies that a column's value is between two values:

$users = DB::table('users')->whereBetween('votes', [1, 100])->get();

The whereNotBetween method verifies that a column's value lies outside of two values:

$users = DB::table('users')->whereNotBetween('votes', [1, 100])->get();

Laravel