$startDate = '2021-06-01'; $endDate = '2021-06-30'; Post::whereBetween(DB::raw('DATE(created_at)'), [$startDate, $endDate])->get();