We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When you scope on multiple tenants Landlord, landlord will use the id of the first tenant on all other tenants.
id
How to reproduce (some 'pseudo' code):
Model with two different tenants
class MyModel extends Model { use BelongsToTenants; public $tenantColumns = ['tenant_a_id', 'tenant_b_id']; }
Add Tenants
Landlord::AddTenant('tenant_a_id', 1); Landlord::AddTenant('tenant_b_id', 2);
Get results
MyModel::all();
If you use barryvdh/laravel-debugbar you can see that the query will be like this:
select * from my_model where tenant_a_id = 1 and tenant_b_id = 1;
The $id for Tenant A is also used for the scope of Tenant B.
$id
The text was updated successfully, but these errors were encountered:
Fixes issue hipsterjazzbo#82. Multiple tenants now use their own id t…
cd34fae
…o scope.
I think this is the same case as #85
Sorry, something went wrong.
Yes @aluferraz. It looks like it is the same issue. At least (almost) the same solution.
@hipsterjazzbo any thoughts on this ? :)
No branches or pull requests
When you scope on multiple tenants Landlord, landlord will use the
id
of the first tenant on all other tenants.How to reproduce (some 'pseudo' code):
Model with two different tenants
Add Tenants
Get results
If you use barryvdh/laravel-debugbar you can see that the query will be like this:
The
$id
for Tenant A is also used for the scope of Tenant B.The text was updated successfully, but these errors were encountered: