我想查看我 30 分钟前提交的哪个订单。我正在使用 Carbon 包来检查这项工作。所以我使用了这段代码,但 Laravel 出现了这个错误: DateTime::__construct(): Failed to parse time string (created_at) at position 0 (c): The timezone could not be found in the database
$now = carbon::now();
$orders= Order::where(Carbon::parse('created_at')->addMinutes(30) ,'>=' , h)->get();
foreach($orders as $order){
if (is_null($orders)){
return 'false';
}else{
return 'true';
}
}
事实上,我不确定我的代码,但如果where(Carbon::parse('created_at')不正确,什么是正确的代码?
繁华开满天机