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

Insert intermediate pivot table #1348

Closed
nemo3000 opened this issue Jan 25, 2020 · 2 comments · Fixed by #1804
Closed

Insert intermediate pivot table #1348

nemo3000 opened this issue Jan 25, 2020 · 2 comments · Fixed by #1804

Comments

@nemo3000
Copy link

I would like to insert a table between Users and the roles/permissions.
I would like something like this:
user1->new_table1->role1
user1->new_table2->role1
user1->new_table3->role2
Can anyone help me?

@drbyte drbyte changed the title Insert table Insert intermediate pivot table Jan 25, 2020
@musapinar
Copy link
Contributor

@nemo3000
Copy link
Author

I have already created relations, but after this how can I pass parameters to filter intermediate table using can()? Now I do somthing like this:
auth()->user()->intermediateTable($filterParameter)->first()->can('edit')
work fine but I think is not the best practice.
In some other posts I see can('edit',$filterParameter) using Gate::before in AuthServiceProvider, I tried work but seem to be only a work around.

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

Successfully merging a pull request may close this issue.

3 participants