1 | <?php |
||||
2 | |||||
3 | namespace App\Service; |
||||
4 | |||||
5 | use Illuminate\Support\Facades\DB; |
||||
6 | use LaravelEnso\Multitenancy\Enums\Connections; |
||||
7 | |||||
8 | class MixedConnection |
||||
9 | { |
||||
10 | public static function set($user, $tenant) |
||||
0 ignored issues
–
show
The parameter
$tenant is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||
11 | { |
||||
12 | // if ($tenant) { |
||||
13 | // self::connection(Connections::Tenant); |
||||
14 | // } else { |
||||
15 | // self::connection('mysql'); |
||||
16 | // } |
||||
17 | // // This is test for tenant db |
||||
18 | // // self::connection(Connections::Tenant); |
||||
19 | |||||
20 | // // $key = 'database.default'; |
||||
21 | // // $value = Connections::Mixed; |
||||
22 | // // config([$key => $value]); |
||||
23 | |||||
24 | // DB::purge(Connections::Mixed); |
||||
25 | |||||
26 | // DB::reconnect(Connections::Mixed); |
||||
27 | } |
||||
28 | |||||
29 | private static function connection($connection) |
||||
0 ignored issues
–
show
|
|||||
30 | { |
||||
31 | $key = 'database.connections.'.Connections::Mixed.'.database'; |
||||
32 | $value = config("database.connections.{$connection}.database"); |
||||
33 | error_log('+++++++++++++++++++++++++++++++++++'.$value); |
||||
34 | config([$key => $value]); |
||||
35 | } |
||||
36 | } |
||||
37 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.