I realized that using whereBetween is not that easy. Personally I have faced problem to use that. Here is the final thought that I can come out-
$month = 01; $year = 2018; return User::whereBetween('created_at', [$year . "-" . $month . "-01 00:00:00", $year . "-" . $month . "-" . cal_days_in_month(CAL_GREGORIAN, $month, $year) . " 23:59:59"]) ->get();
Here I used a php function called cal_days_in_month() so that you can use any year and month that you want.