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