我试图从created_at
个日期超过30 days from today个的模型"用户"中提取对象.
Carbon::now() ==> I want as ==> Carbon::now() - 30days
$users = Users::where('status_id', 'active')
->where( 'created_at', '<', Carbon::now())
->get();
如何做到这一点?
我试图从created_at
个日期超过30 days from today个的模型"用户"中提取对象.
Carbon::now() ==> I want as ==> Carbon::now() - 30days
$users = Users::where('status_id', 'active')
->where( 'created_at', '<', Carbon::now())
->get();
如何做到这一点?
使用subDays()
方法:
$users = Users::where('status_id', 'active')
->where( 'created_at', '>', Carbon::now()->subDays(30))
->get();