Skip to content

Commit

Permalink
addes as parameter database tenant prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
peretch committed May 18, 2020
1 parent 3bea432 commit 87b5830
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/createNewTenant.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 87b5830

Please sign in to comment.