Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | public function handle(Request $request, Closure $next, string $database, string $name, null|string $postFix = null) |
||
14 | { |
||
15 | $request->merge([config('dynamicdatabaseconfig.connection_name', '_db_connection') => $name]); |
||
16 | |||
17 | if (!$postFix) { |
||
18 | $postFix = session(config('dynamicdatabaseconfig.session_postfix')); |
||
19 | } |
||
20 | |||
21 | $newConfig = $this->setNewEnvConfig($database, $postFix); |
||
22 | $this->addNewConfig($database, $name, $newConfig); |
||
23 | $this->createDatabase($database, $newConfig['database']); |
||
24 | |||
25 | return $next($request); |
||
26 | } |
||
29 |