📅  最后修改于: 2022-03-11 14:54:49.029000             🧑  作者: Mango
$startDate = Carbon::createFromFormat('Y-m-d', '2021-06-01');
$endDate = Carbon::createFromFormat('Y-m-d', '2021-06-30');
$posts = Post::whereBetween('created_at', [$startDate, $endDate])->get();