@@ -40,23 +40,23 @@ public function register()
4040 // we'll use the connection name configured in the 'default' config setting from the 'pubsub_events'
4141 // config
4242 // if this value isn't set, we'll default to that from the 'pubsub' package config
43- $ config = $ app [ ' config ' ][ ' pubsub_events ' ] ;
43+ $ config = $ this -> getConfig () ;
4444 $ manager = $ app ['pubsub ' ]; /** @var PubSubManager $manager */
4545 return $ manager ->connection ($ config ['default ' ]);
4646 });
4747
4848 $ this ->app ->bind ('pubsub.events.translator ' , MessageTranslatorInterface::class);
4949
5050 $ this ->app ->bind (MessageTranslatorInterface::class, function ($ app ) {
51- $ config = $ app [ ' config ' ][ ' pubsub_events ' ] ;
51+ $ config = $ this -> getConfig () ;
5252 $ binding = $ config ['translator ' ];
5353 return $ app [$ binding ];
5454 });
5555
5656 $ this ->app ->bind ('pubsub.events.validator ' , EventValidatorInterface::class);
5757
5858 $ this ->app ->bind (EventValidatorInterface::class, function ($ app ) {
59- $ config = $ app [ ' config ' ][ ' pubsub_events ' ] ;
59+ $ config = $ this -> getConfig () ;
6060 $ binding = $ config ['validator ' ];
6161 // a validator is optional
6262 // if nothing is set, we don't try resolve it
@@ -98,7 +98,7 @@ protected function registerTranslators()
9898 protected function registerValidators ()
9999 {
100100 $ this ->app ->singleton ('pubsub.events.validators.json_schema.loaders.array.schemas ' , function ($ app ) {
101- $ config = $ app [ ' config ' ][ ' pubsub_events ' ] ;
101+ $ config = $ this -> getConfig () ;
102102 $ schemas = $ config ['validators ' ]['json_schema ' ]['loaders ' ]['array ' ]['schemas ' ];
103103 return collect ($ schemas );
104104 });
@@ -116,7 +116,7 @@ protected function registerValidators()
116116 $ this ->app ->bind ('pubsub.events.validators.json_schema.dereferencer ' , function ($ app ) {
117117 $ dereferencer = new Dereferencer ();
118118
119- $ config = $ app [ ' config ' ][ ' pubsub_events ' ] ;
119+ $ config = $ this -> getConfig () ;
120120
121121 foreach ($ config ['validators ' ]['json_schema ' ]['loaders ' ] as $ name => $ params ) {
122122 $ name = array_get ($ params , 'binding ' , $ name );
@@ -133,6 +133,15 @@ protected function registerValidators()
133133 });
134134 }
135135
136+ /**
137+ * @return array
138+ */
139+ protected function getConfig ()
140+ {
141+ $ config = $ this ->app ->make ('config ' ); /** @var \Illuminate\Config\Repository $config */
142+ return $ config ->get ('laravel4-event-pubsub::config ' );
143+ }
144+
136145 /**
137146 * Get the services provided by the provider.
138147 *
0 commit comments