hipsterjazzbo / Landlord

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

Add option to use or not table name on query filter #28

Closed nunomazer closed 7 years ago

nunomazer commented 8 years ago

I was having problems to use the package with MongoDB and jenssegers/mongodb driver. The problem was that when the query with where by tenant id is build, the table name is added always.

This PR add a config named query_with_table_name set as default to true, to keep the original behavior. When this option is set to false, than table name is not used, only the column name.

hipsterjazzbo commented 7 years ago

I think I'll hold of on this for now. I'd rather come up with some way that qualifies the column name in a driver based way, rather than removing it completely.

nunomazer commented 7 years ago

So do you think a better strategy would be test the driver and then use the correct qualifier? I can do this way so