hipsterjazzbo / Landlord

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

What is the purpose of the config file? #29

Closed eberkund closed 7 years ago

eberkund commented 8 years ago

In the documentation it says I can set a site wide default tenant column but the app/landlord.php file doesn't seem to do anything.

'default_tenant_columns' => ['tenant_id'],

I still have to specify the $tenantColumn in my middleware or anywhere else I want to use it.

public function handle($request, Closure $next)
{
    $tenantColumn = 'tenant_id';
    $tenantId = '1';

    Landlord::addTenant($tenantColumn, $tenantId);

    return $next($request);
}
nunomazer commented 8 years ago

The queries builded to select only the tenant records use this config

eberkund commented 8 years ago

Could you give an example?

hipsterjazzbo commented 7 years ago

Yeah I can see that'd be confusing. It's used when building the queries that actually do the scoping.