to get picture count you might wanna try
$label->pictures()->count(); // notice the brackets on the relationship
this will do a "select count(*) as aggregate from ....."
I think that doesn't solve my usecasse. I would get counts for all pictures but I just want to count the number of labels for picture ids 7 and 12 (in this example).
Did I miss something?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community