hipsterjazzbo / Landlord

A simple, single database multi-tenancy solution for Laravel 5.2+
MIT License
614 stars 138 forks source link

Multiple Tenants in where #26

Closed anbraten closed 7 years ago

anbraten commented 8 years ago

https://github.com/HipsterJazzbo/Landlord/blob/master/src/Landlord.php#L93

here you are adding all tenants with id to the builder and the result should look like: select * from ... where id=anton and id=lukas

and that cant work?!

I think it should be $builder->orwhere ...

Or am I wrong?

warksit commented 8 years ago

I think this is for when you have 2 different tenant columns in which case you would want andWhere. It is not for handling being a member of 2 different tenants which is not supported.

hipsterjazzbo commented 7 years ago

What @warksit said is correct. This package is for scoping to a single tenant of any given type.