Base table or view not found: 1146 Table 'role_user' doesn't exist
mohitbabel opened this issue · comments
I am using spatie version 5. Whenever I assign new role using this function $user->assignRole('Admin') but I am getting an exception that
Base table or view not found: 1146 Table 'cryo_renewal.role_user' doesn't exist (Connection: mysql, SQL: delete from role_user
where role_user
.user_id
= 1) in spatie laravel problem. What is that error can anyone explain.
php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider"
run this command it should work
Hello everyone!!!. I have problem with laravel permission on migrating , how you can see in the picture !
Duplicate of #2650
Potential FIX:
If you have roles()
or permissions()
defined inside User
remove it. It's conflicting with the HasRoles
.