I am using the Laravel 4 php framework and I need to use the fluent query builder to get some statistical type data. I have a database table with a structure like the follwing
id: int
group_id: int
sent_at: datetime
message_id: int
I need a fluent query that will get the count of all rows that have the same message id, and I want to also have that count organized by the group_id.
For example, I have a message id of 1, and each row with the message id of 1 has a group id that may or may not be the same. I need to know what group id's there are in the table for a given message id, and also how many total there is for each group id.
I hope that makes sense.
Thank you for any help.