Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Base table or view not found: 1146 Table 'role_user' doesn't exist #2590

Closed
mohitbabel opened this issue Jan 9, 2024 · 6 comments
Closed

Comments

@mohitbabel
Copy link

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.

@parallels999
Copy link
Contributor

parallels999 commented Jan 9, 2024

@drbyte drbyte changed the title Laravel spatie teams permission is not working properly. Base table or view not found: 1146 Table 'role_user' doesn't exist Jan 9, 2024
@SaifullahAkhtar-001
Copy link

SaifullahAkhtar-001 commented Jan 30, 2024

php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider"
run this command it should work

@R00TR41Z
Copy link

R00TR41Z commented Apr 5, 2024

Hello everyone!!!. I have problem with laravel permission on migrating , how you can see in the picture
spatie-permission
I need your help friends

@drbyte
Copy link
Collaborator

drbyte commented Apr 18, 2024

Hello everyone!!!. I have problem with laravel permission on migrating , how you can see in the picture !

Duplicate of #2650

@drbyte drbyte closed this as completed Apr 18, 2024
@xyznaveen
Copy link

Potential FIX:

If you have roles() or permissions() defined inside User remove it. It's conflicting with the HasRoles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants