-
Description:The The problem is that the underlying I can give a slightly similar situation: public function calculate(NovaRequest $request)
{
$query = Post::query()->addSelect(DB::raw('JSON_EXTRACT(meta, "$.views") AS total_views'));
return $this->count($request, $query, 'total_views');
}The $results = $query->select( // This one
$groupBy, DB::raw("{$function}({$wrappedColumn}) as aggregate")
)->groupBy($groupBy)->get(); |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Yes you should write and output sql result manually if the provided method can't be used. |
Beta Was this translation helpful? Give feedback.
-
|
Also why not: public function calculate(NovaRequest $request)
{
return $this->count($request, Post::query(), DB::raw('JSON_EXTRACT(meta, "$.views")'));
} |
Beta Was this translation helpful? Give feedback.
Also why not: