I want to count and retrieve data for different periods like today, total, this week, etc.
How to count for example this_week?
Here is starting code:
public function findTotalRegistered(Query $query, Array $options)
{
$total = $query->func()->count('id');
$query
->select([
'total' => $total,
//'today' => $today,
//'this_week' => $this_week,
//'this_month' => $this_month,
//'this_year' => $this_year
]);
return $query;
}