HipsterJazzbo\Landlord\TenantManager::getTenantKey PHP Method

getTenantKey() protected method

Get the key for a tenant, either form a Model instance or a string.
protected getTenantKey ( string | Model $tenant ) : string
$tenant string | Illuminate\Database\Eloquent\Model
return string
    protected function getTenantKey($tenant)
    {
        if ($tenant instanceof Model) {
            $tenant = $tenant->getForeignKey();
        }
        if (!is_string($tenant)) {
            throw new TenantColumnUnknownException('$tenant must be a string key or an instance of \\Illuminate\\Database\\Eloquent\\Model');
        }
        return $tenant;
    }