select 个自 laravel 创建以来已超过 24 小时的模型

select models that more than 24 hours have passed since their creation in laravel

我认为问题标题是 Self-Descriptive。

事实上,我想 select 超过 24 的所有行,因为它们在 laravel 中的 created_at 属性与 where clauses.

$question = Question::where('created_at',/* what do I here*/);

我该怎么做?

试试这个:

$question = Question::where('created_at', '>=', Carbon::now()->subDay())->get();

Description

$question = Question::where('created_at', date("Y-m-d H:i:s",strtotime("22-11-2016"."-1 day")));