F
Filament15mo ago
jop00

Group table by year

Is it possible to group a table by 'year' from a date column?
3 Replies
jop00
jop00OP15mo 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...
Want results from more Discord servers?
Add your server