Level 24
Does your users table have a role_id column? If not that won't work. What is your relationship setup and table structure?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I want to list the users with roles through role id how we can do that my approach to do is
User::with("roles")->where("role_id", 1);
but its gives error of column not found role_id
Please or to participate in this conversation.