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

'testspatie.role_user' doesn't exist #1507

Closed
tzriqat opened this issue Jun 19, 2020 · 6 comments
Closed

'testspatie.role_user' doesn't exist #1507

tzriqat opened this issue Jun 19, 2020 · 6 comments

Comments

@tzriqat
Copy link

tzriqat commented Jun 19, 2020

Hi guys,
I'm recieving this error when trying to assign roles to a user
Base table or view not found: 1146 Table 'testspatie.role_user' doesn't exist (SQL: delete from role_user where user_id = 18)

DD for user id is correct, and checkbox values are returning roles id are correct as well.

    public function roleAssignToUsers(Request $request)
    {
        $user = User::find($request->user_id);
        //dd($user);
        //dd($request->input('roles'));

        $inputroles = $request->input('roles');
        $user->syncRoles($inputroles);
        
        return view('cp.roles.index'));
    }
@drbyte
Copy link
Collaborator

drbyte commented Jun 19, 2020

It seems like you have other relations coded into your app and Laravel is self-determining a table-name for those relationships.
In short: your app's code conflicts with (is overriding) method names and relations and models that this package provides.

@tzriqat
Copy link
Author

tzriqat commented Jun 19, 2020

Yes indeed. thanks @drbyte It is resolved now.

@tzriqat tzriqat closed this as completed Jun 19, 2020
@anuragyantra
Copy link

@drbyte
Can you please share, how you resolved this issue ?

@danti96
Copy link

danti96 commented Feb 2, 2022

como resolvió este problema

@mohitbabel
Copy link

Same problem faced please tell how to resolve that problem

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

5 participants