@@ -106,10 +106,11 @@ protected function configureLoggers()
106106 */
107107 protected function configureManagers ()
108108 {
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 ' ;
111112
112- $ class = config ( " websockets. replication. modes. { $ mode} . channel_manager" ) ;
113+ $ class = $ config[ ' replication ' ][ ' modes ' ][ $ mode][ ' channel_manager ' ] ;
113114
114115 return new $ class ($ this ->loop );
115116 });
@@ -211,9 +212,9 @@ protected function configurePongTracker()
211212 */
212213 protected function configureHttpLogger ()
213214 {
214- $ this ->laravel ->singleton (HttpLogger::class, function () {
215+ $ this ->laravel ->singleton (HttpLogger::class, function ($ app ) {
215216 return (new HttpLogger ($ this ->output ))
216- ->enable ($ this ->option ('debug ' ) ?: config ( ' app. debug ' ))
217+ ->enable ($ this ->option ('debug ' ) ?: ( $ app [ ' config ' ][ ' app ' ][ ' debug '] ?? false ))
217218 ->verbose ($ this ->output ->isVerbose ());
218219 });
219220 }
@@ -225,9 +226,9 @@ protected function configureHttpLogger()
225226 */
226227 protected function configureMessageLogger ()
227228 {
228- $ this ->laravel ->singleton (WebSocketsLogger::class, function () {
229+ $ this ->laravel ->singleton (WebSocketsLogger::class, function ($ app ) {
229230 return (new WebSocketsLogger ($ this ->output ))
230- ->enable ($ this ->option ('debug ' ) ?: config ( ' app. debug ' ))
231+ ->enable ($ this ->option ('debug ' ) ?: ( $ app [ ' config ' ][ ' app ' ][ ' debug '] ?? false ))
231232 ->verbose ($ this ->output ->isVerbose ());
232233 });
233234 }
@@ -239,9 +240,9 @@ protected function configureMessageLogger()
239240 */
240241 protected function configureConnectionLogger ()
241242 {
242- $ this ->laravel ->bind (ConnectionLogger::class, function () {
243+ $ this ->laravel ->bind (ConnectionLogger::class, function ($ app ) {
243244 return (new ConnectionLogger ($ this ->output ))
244- ->enable (config ( ' app. debug ') )
245+ ->enable ($ app [ ' config ' ][ ' app ' ][ ' debug '] ?? false )
245246 ->verbose ($ this ->output ->isVerbose ());
246247 });
247248 }
0 commit comments