Conditions | 1 |
Paths | 1 |
Total Lines | 38 |
Lines | 0 |
Ratio | 0 % |
Tests | 20 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
27 | 12 | public function handle() |
|
28 | { |
||
29 | 12 | $path = base_path('laravel-echo-server.json'); |
|
30 | 12 | file_put_contents( |
|
31 | 12 | $path, |
|
32 | 12 | json_encode(array_replace_recursive([ |
|
33 | 12 | 'authHost' => url('/'), |
|
34 | 12 | 'authEndpoint' => '/broadcasting/auth', |
|
35 | 12 | 'database' => 'redis', |
|
36 | 'databaseConfig' => [ |
||
37 | 'redis' => [ |
||
38 | 12 | 'host' => config('database.redis.default.host'), |
|
39 | 12 | 'port' => config('database.redis.default.port'), |
|
40 | ], |
||
41 | 'sqlite' => [ |
||
42 | 'databasePath' => '/storage/laravel-echo-server.sqlite', |
||
43 | ], |
||
44 | ], |
||
45 | 12 | 'devMode' => config('app.debug'), |
|
46 | 12 | 'host' => parse_url(url('/'), PHP_URL_HOST), |
|
47 | 12 | 'port' => 6001, |
|
48 | 12 | 'protocol' => 'http', |
|
49 | 'socketio' => [], |
||
50 | 12 | 'sslCertPath' => '', |
|
51 | 12 | 'sslKeyPath' => '', |
|
52 | 12 | 'sslCertChainPath' => '', |
|
53 | 12 | 'sslPassphrase' => '', |
|
54 | 'apiOriginAllow' => [ |
||
55 | 'allowCors' => false, |
||
56 | 'allowOrigin' => '', |
||
57 | 'allowMethods' => '', |
||
58 | 'allowHeaders' => '', |
||
59 | ], |
||
60 | 12 | ], $this->config), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) |
|
61 | ); |
||
62 | |||
63 | 12 | return 'Config file for web-socket server created. File: '.$path; |
|
64 | } |
||
65 | } |
||
66 |