答案 0 :(得分:1)
尝试一下:
Route::get('a/{day}/{month}/{year}', function ($day, $month, $year) {
$users = App\User::whereDay('created_at',$day)
->whereMonth('created_at', $month)
->whereYear('created_at', $year)->get();
return view('your-view', compact('users', 'day', 'month', 'year'))
});
您应遵循变量顺序。
您的问题是,您将URL参数中的day
传递给了$year
参数,反之亦然。