Laravel Eloquent whereBetween Example

In this example, You learn laravel eloquent wherebetween example, example of laravel where between eloquent, laravel eloquent wherebetween dates, example of laravel wherebetween date format, simple example of laravel eloquent wherebetween, Laravel where date between two columns.

whereBetween() will help you to getting data with between two dates or two values from database in laravel application.

Read Also :  How to Get Config Directory Path in Laravel

Example of laravel eloquent whereBetween

<?php
   
namespace App\Http\Controllers;
    
use Illuminate\Http\Request;
use App\User;
  
class UserController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        $users = User::select("*")
                        ->whereBetween('points', [1, 100])
                        ->get();
  
        dd($users);
    }
}

I hope you understand of laravel eloquent wherebetween and it can help you.