@@ -106,10 +106,11 @@ protected function configureLoggers()
106
106
*/
107
107
protected function configureManagers ()
108
108
{
109
- $ this ->laravel ->singleton (ChannelManager::class, function () {
110
- $ mode = config ('websockets.replication.mode ' , 'local ' );
109
+ $ this ->laravel ->singleton (ChannelManager::class, function ($ app ) {
110
+ $ config = $ app ['config ' ]['websockets ' ];
111
+ $ mode = $ config ['replication ' ]['mode ' ] ?? 'local ' ;
111
112
112
- $ class = config ( " websockets. replication. modes. { $ mode} . channel_manager" ) ;
113
+ $ class = $ config[ ' replication ' ][ ' modes ' ][ $ mode][ ' channel_manager ' ] ;
113
114
114
115
return new $ class ($ this ->loop );
115
116
});
@@ -211,9 +212,9 @@ protected function configurePongTracker()
211
212
*/
212
213
protected function configureHttpLogger ()
213
214
{
214
- $ this ->laravel ->singleton (HttpLogger::class, function () {
215
+ $ this ->laravel ->singleton (HttpLogger::class, function ($ app ) {
215
216
return (new HttpLogger ($ this ->output ))
216
- ->enable ($ this ->option ('debug ' ) ?: config ( ' app. debug ' ))
217
+ ->enable ($ this ->option ('debug ' ) ?: ( $ app [ ' config ' ][ ' app ' ][ ' debug '] ?? false ))
217
218
->verbose ($ this ->output ->isVerbose ());
218
219
});
219
220
}
@@ -225,9 +226,9 @@ protected function configureHttpLogger()
225
226
*/
226
227
protected function configureMessageLogger ()
227
228
{
228
- $ this ->laravel ->singleton (WebSocketsLogger::class, function () {
229
+ $ this ->laravel ->singleton (WebSocketsLogger::class, function ($ app ) {
229
230
return (new WebSocketsLogger ($ this ->output ))
230
- ->enable ($ this ->option ('debug ' ) ?: config ( ' app. debug ' ))
231
+ ->enable ($ this ->option ('debug ' ) ?: ( $ app [ ' config ' ][ ' app ' ][ ' debug '] ?? false ))
231
232
->verbose ($ this ->output ->isVerbose ());
232
233
});
233
234
}
@@ -239,9 +240,9 @@ protected function configureMessageLogger()
239
240
*/
240
241
protected function configureConnectionLogger ()
241
242
{
242
- $ this ->laravel ->bind (ConnectionLogger::class, function () {
243
+ $ this ->laravel ->bind (ConnectionLogger::class, function ($ app ) {
243
244
return (new ConnectionLogger ($ this ->output ))
244
- ->enable (config ( ' app. debug ') )
245
+ ->enable ($ app [ ' config ' ][ ' app ' ][ ' debug '] ?? false )
245
246
->verbose ($ this ->output ->isVerbose ());
246
247
});
247
248
}
0 commit comments