AuraEQ/laravel-multi-tenant — pull request #3 by HipsterJazzbo (2014-07-12 04:37:31+00:00)
Title: Refactored how the tenant id is set and used

I've come up with this as a potential solution to #2.

instead of providing a callback in the config to retrieve the tenant id, you would have to call `TenantScope::setTenantId($tenantId)` to set it on login, or whatever other event requires you to set/change the current tenant.

If `TenantScope::$tenant_id` is not set, it'll just return from the `apply()` method and not scope the request. This is nessecary for cases where you may want to log out and then log in a different user – the second login request cannot be scoped or it is likely to fail.

It works okay, and is nice and flexible, but I'm not sure if I like how it leaves you open to forget to set (or accidentally unset) the tenant id.

Thoughts?