I think you will go for a query builder with some join and raw sql here...
Jan 17, 2019
4
Level 102
whereHas using muliple tables (or perhaps join)
Hi I have 3 tables. users, pages and user_groups Each user is part of a user group and on the table is a max_pages column. Now I need to get all users that still have not exceeded their max_pages count.
Is there an eloquent way of doing this or do I need to use the query builder. I was hoping that I somehow could use whereHas but I cannot get it to work at all, sadly.
I am using mssql and laravel 5.7
Please or to participate in this conversation.