Skip to content
Advertisement

Laravel many to many relastionship count

I have two tables. User and days, with many to many relationship. user_days : user_id, day_id

I want to get the count number of users in day_id = 1 {for a particular day} or something like this. Any way to get count from pivot table? This function didnot work.

the table structure ?

How do I find the user count of users on that particular day??

Advertisement

Answer

Get the count of users related to that day.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement