Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 2 years ago.
0

I don't understand the "grouping by weeks", is that week number by month (or year) or week_date? And with this kind of selecting, I'd rather use raw sql instead (DB::query()). Something like:

select week(time) as week_select from <table> group by week_select;

Or using mysql TimeDiff function. The worst case is you have to pull all data and process it manually by php, which is of course more freedom.

Last updated 2 years ago.
0

My hope is that I can do it with the same dataset.

As for week number by month, vs week_date, I know ideally i'd want week number. However, with what i've been playing around with carbon combined with goofy loops, I'm not sure I can get that.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.