1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-13 18:24:04 +00:00

[2.x] Tenant config (#145)

* TenantConfig first draft

* Apply fixes from StyleCI

* Add unsetTenantConfig

* Fix DB storage driver bug, add regression test (tenant_data_can_be_set_during_creation)

* Add tests & config keys

* Apply fixes from StyleCI
This commit is contained in:
Samuel Štancl 2019-09-30 16:52:46 +02:00 committed by GitHub
parent d70e561106
commit 56a2bdf5af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 109 additions and 1 deletions

View file

@ -80,7 +80,7 @@ class DatabaseStorageDriver implements StorageDriver
public function createTenant(Tenant $tenant): void
{
$this->centralDatabase->transaction(function () use ($tenant) {
Tenants::create(['id' => $tenant->id, 'data' => '{}'])->toArray();
Tenants::create(['id' => $tenant->id, 'data' => json_encode($tenant->data)])->toArray();
$domainData = [];
foreach ($tenant->domains as $domain) {