I am using Laravel Nova to generate metrics, in this case specifically a trend. Here is my code:
$builder = order::query()->select('cook_id')->distinct();
return $this->countByDays($request, $builder)->showLatestValue();
However this is returning 6 - but it should be 4.
Yes there are 6 rows, but four of them have the same 'cook_id' and thus the distinct call should be eliminating 2 of those.
To reiterate, this is in Laravel Nova's "trend" metric.
Thanks