app\models\Task::scopeDateRange PHP Method

scopeDateRange() public method

public scopeDateRange ( $query, $startDate, $endDate )
    public function scopeDateRange($query, $startDate, $endDate)
    {
        $query->whereRaw('cast(substring(time_log, 3, 10) as unsigned) >= ' . $startDate->format('U'));
        $query->whereRaw('cast(substring(time_log, 3, 10) as unsigned) <= ' . $endDate->format('U'));
        return $query;
    }