F
Filament16mo ago
jop00

Group table by year

Is it possible to group a table by 'year' from a date column?
4 Replies
jop00
jop00OP16mo ago
I've tried ->groupQueryUsing() but doesn't change the default grouping
->groupQueryUsing(fn (Builder $query) => $query->groupBy(DB::raw("YEAR(deadline)")))
->groupQueryUsing(fn (Builder $query) => $query->groupBy(DB::raw("YEAR(deadline)")))
This doesn't change the default grouping by day Could someone test if groupQueryUsing() is actually working?
johnnie_littleshoes
I want to group by "month-year" but can't seem to make it work either...
David | Fortune Validator
a year late but didnt anyone figure this out?

Did you find this page helpful?