From 87b58305c24f0b03fb35c94a9d3bc5df520a7348 Mon Sep 17 00:00:00 2001 From: peretch Date: Mon, 18 May 2020 18:39:34 -0300 Subject: [PATCH] addes as parameter database tenant prefix --- .env.example | 1 + app/Console/Commands/createNewTenant.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index a6d989a..e8a1aff 100644 --- a/.env.example +++ b/.env.example @@ -21,6 +21,7 @@ TENANCY_USERNAME=tenancy TENANCY_PASSWORD=tenancy TENANCY_DEFAULT_CONNECTION=system +TENANT_DATABASE_PREFIX=tenant_db_ BROADCAST_DRIVER=log CACHE_DRIVER=file diff --git a/app/Console/Commands/createNewTenant.php b/app/Console/Commands/createNewTenant.php index 0af1e04..57d0afe 100644 --- a/app/Console/Commands/createNewTenant.php +++ b/app/Console/Commands/createNewTenant.php @@ -50,7 +50,7 @@ public function handle() { $fqdn = sprintf('%s.%s', $this->argument('fqdn'), env('APP_DOMAIN')); $website = new Website; - $website->uuid = 'tenant_' . Str::random(6); + $website->uuid = env('TENANT_DATABASE_PREFIX') . Str::random(6); app(WebsiteRepository::class)->create($website); $hostname = new Hostname; $hostname->fqdn = $fqdn;