我正在尝试从模型“用户”中提取对象,其 created_at
日期 从今天开始已经超过 30 天。
Carbon::now() ==> 我想要 ==> Carbon::now() - 30 天
$users = Users::where('status_id', 'active')
->where( 'created_at', '<', Carbon::now())
->get();
如何实现?
原文由 cosmoloc 发布,翻译遵循 CC BY-SA 4.0 许可协议
使用
subDays()
方法: