Hey!
You're doing a mix of a few things here:
So you have to choose, do you want to assign multiple roles to a user, then belongsToMany would be correct and role_id should be removed from the users table. OR Do you want to assign only one role to a user, then all the other code needs to be updated and the belongsToMany needs to be converted to a belongsTo relationship.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community