Adding global scope with inersetOrUpdate method #47963
Unanswered
muhammadessam
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have an existing code where I'm trying to add multi-tenancy to it.
I add a global scope to all models the problem is there exist a lot of code where the method insertOrupdate is updating some settings
here is my setup:
and this is my mdoel setup:
now the problem is in this code :
this is the controller constructor:
and here is the method update:
now I want to apply the global scope so to all insertOrUpdate to by like:
is there any way to do it automatically without manually add the 'tenant_id => session(('tenant_id') to every statment.
Beta Was this translation helpful? Give feedback.
All reactions