Open Amitoj02 opened 9 months ago
You can use the interval()
method which is used internally by the Trend class, something like this:
Trend::query(Model::class->where('condition', value))
->between(
start: date,
end: date,
)
->interval('week')
->count();
(code not tested but it should work, although correct me if i'm wrong)
You can use the
interval()
method which is used internally by the Trend class, something like this:Trend::query(Model::class->where('condition', value)) ->between( start: date, end: date, ) ->interval('week') ->count();
(code not tested but it should work, although correct me if i'm wrong)
Error: Invalid Interval.
return match ($this->interval) {
'minute' => 'Y-m-d H:i:00',
'hour' => 'Y-m-d H:00',
'day' => 'Y-m-d',
'month' => 'Y-m',
'year' => 'Y',
default => throw new Error('Invalid interval.'),
};
It will be very useful to have perQuarter() aggregate interval. Thank you.
Any news on this issue?
@davidvandertuijn +1 to what you just said, I was just around it
Ok managed to get around quarters but not without "hacking" into some stuff
Now is whether the author(s) of this package want to mess the "normal" API flow or not (if it was me: I would just release a major)
Note: I didn't manage to make it work within SQLite cause I really don't understand its syntax and I never use it
Mentioned here the quarter for those who might be interested: #56
It will be very useful to have
perWeek()
aggregate interval. Thank you.