Laravel: Select and Compare Data with Date

On

If you want to selecting a data with two date start date and end date in laravel so you can use given example below- Example 1: $start_date=carbon::parse($startDate)->format(“Y-m-d”); $end_date=carbon::parse($endDate)->format(“Y-m-d”); $query=User::query(); $query->whereDate(“created_at”,”>=”, $start_date); $query->whereDate(“created_at”,”<=”, $start_date); $query->get(); And If you want selecting a data with…

error: