You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How to prevent the error when a role or permission does not have any user?
I am listing all roles and all permissions, for the requirements I can't left anyone out, but when I try
->withCount(['roles', 'users'])
If a role or permission does not have any user relationship throws an error
Error: Class name must be a valid object or a string in file /vagrant/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php on line 745
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
How to prevent the error when a role or permission does not have any user?
I am listing all roles and all permissions, for the requirements I can't left anyone out, but when I try
If a role or permission does not have any user relationship throws an error
Any thoughts?
Beta Was this translation helpful? Give feedback.
All reactions