I want to count records where updated_at is 2 hours older than created_at.
Code
$teLang = $kentekens->where('updated_at', '>', 'created_at'->subHours(2));
Unfortunately this doesn't work because subHours(2) is for carbon but hopefully you get the idea.
View
<h1>{{ $teLang->count() }}</h1>
Controller
public function create() {
$kentekens = Kenteken::latest()
->where('created_at', '>=', Carbon::today())
->get();
$teLang = $kentekens->where('updated_at', '>', 'created_at'->subHours(2));
return view('layouts.dashboard', compact('kentekens', 'teLang'));
}
anyone know how?