Skip to content

Commit

Permalink
Merge pull request #954 from portabilis/tenant
Browse files Browse the repository at this point in the history
Evita ter que modificar o host
  • Loading branch information
edersoares authored Jun 20, 2024
2 parents ef56356 + 1cf0732 commit a628a41
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/Http/Middleware/ConnectTenantDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function handle($request, Closure $next)

if (isset($connections[$tenant])) {
DB::setDefaultConnection($tenant);
} elseif ($tenant !== config('app.default_host')) {
} elseif (config('app.multi_tenant')) {
abort(404);
}

Expand Down
3 changes: 3 additions & 0 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,5 +200,8 @@

'default_host' => env('APP_DEFAULT_HOST', 'ieducar.com.br'),

'multi_tenant' => env('APP_MULTI_TENANT', false),

'nickname' => 'ieducar',

];

0 comments on commit a628a41

Please sign in to comment.