where('date', '>=', $from_date.' 00:00:00'); } if (!empty($to_date)){ $query->where('date', '<=', $to_date.' 23:59:59'); } return $query; } public function currentValue() { return ['from' => '', 'to' => '']; //return ['from' => '2022-04-01', 'to' => '2022-04-06']; } }