I wasn't able to find any discussion section or a way to reach you. that's why I've opened the issue here.
I really need help.
Please take a bit of time for me,
my query is
I need to show user registrations every month for the last year.
I did this query in Laravel eloquent but didn't find a solution for how to do this query in Lucid.
Please note! I'm using PostgreSQL and cockroach db
I need somehow,, group users count by ( created_at---> month name ) for last year
User Table
id ----- username ---- email ---- created_at ---- updated_at
Raw query would be something like that ----> for postgreSQL
SELECT
to_char(date_trunc('month', created_at), 'YYYY, Month') AS created_month,
COUNT(id) AS total_registrations,
FROM users
GROUP BY date_trunc('month', created_at)
ORDER BY date_trunc('month', created_at)
But I really need to know how I can do this using Lucid ORM
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This is actually not an issue!
Hello @thetutlage
I wasn't able to find any discussion section or a way to reach you. that's why I've opened the issue here. I really need help.
Please take a bit of time for me,
my query is
I need to show user registrations every month for the last year. I did this query in Laravel eloquent but didn't find a solution for how to do this query in Lucid. Please note! I'm using PostgreSQL and cockroach db
I need somehow,, group users count by ( created_at---> month name ) for last year
User Table
id ----- username ---- email ---- created_at ---- updated_at
Raw query would be something like that ----> for postgreSQL
SELECT to_char(date_trunc('month', created_at), 'YYYY, Month') AS created_month, COUNT(id) AS total_registrations, FROM users GROUP BY date_trunc('month', created_at) ORDER BY date_trunc('month', created_at)
But I really need to know how I can do this using Lucid ORM
I'll appreciate any help from you. Best regards!