【发布时间】:2018-07-01 13:51:42
【问题描述】:
我想计算使用以下代码得到的输出:
刀片视图
{{ $kentekens->where('created_at', '>=', Carbon::today()) }}
这给出了字符串的输出,但我想计算它获得的匹配数量。 我尝试了以下但没有成功:
{{ $kentekens->where('created_at', '>=', Carbon::today()->count()) }}
{{ $kentekens->count()->where('created_at', '>=', Carbon::today()) }}
控制器
public function create() {
$kentekens = Kenteken::latest()
->get();
return view('layouts.dashboard', compact('kentekens'));
}
型号
class Kenteken extends Model {
protected $table = "kenteken";
}
有人知道吗?
【问题讨论】:
标签: php mysql laravel eloquent php-carbon