BETWEEN '2020-02-22 00:00:00' AND '2020-02-22 23:59:59' is working (getting Data)?
BETWEEN '2020-02-22' AND '2020-02-22' is not working (Not getting Data)?
Edited: Got it. I forgot to add
date(created_at) instead of
You may use the
It verifies that a column’s value is between two values.
$from = date('2018-01-01'); $to = date('2018-05-02'); Model::whereBetween('dateColumn', [$from, $to])->get();
Model::where('dateColumn', '>=', $from)->where('dateColumn', '<=', $to)->get();