1//get or exist data between two dates
2return Set::where('type', $type)
3 ->whereDate('active_start', '<=', date("Y-m-d"))
4 ->whereDate('active_end', '>=', date("Y-m-d"))
5 ->first();
6//@sujay
1<?php
2 //check if date between two dates
3$currentDate = date('Y-m-d');
4$currentDate = date('Y-m-d', strtotime($currentDate));
5$startDate = date('Y-m-d', strtotime("01/09/2019"));
6$endDate = date('Y-m-d', strtotime("01/10/2019"));
7if (($currentDate >= $startDate) && ($currentDate <= $endDate)){
8 echo "Current date is between two dates";
9}else{
10 echo "Current date is not between two dates";
11}
12//@sujay