9 months ago

Universal (database) groupBy formatted date

Posted 9 months ago by ardf16

Is there 'eloquent' solution for grouping results by formatted date that will not include having raw query like :

DB::raw("FORMAT(created_at, 'MM-yyyy') AS created_month")

which is not only ugly but also platform - specific.

I would like to make my application reusable on different environments without writting platform - specific code.

Please sign in or create an account to participate in this conversation.