This repository was archived by the owner on Jul 24, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -36,16 +36,26 @@ public function register()
3636 {
3737 // Bind the Adldap instance to the IoC
3838 $ this ->app ->bind ('adldap ' , function () {
39- $ config = $ this ->app ['config ' ]->get ('adldap ' );
39+ $ config = $ this ->app ['config ' ];
40+
41+ $ settings = $ config ->get ('adldap ' );
4042
4143 // Verify configuration.
42- if (is_null ($ config )) {
44+ if (is_null ($ settings )) {
4345 $ message = 'Adldap configuration could not be found. Try re-publishing using `php artisan vendor:publish --tag="adldap"`. ' ;
4446
4547 throw new ConfigurationMissingException ($ message );
4648 }
4749
48- return new Adldap ($ config ['connection_settings ' ], new $ config ['connection ' ](), $ config ['auto_connect ' ]);
50+ // Create a new Adldap instance.
51+ $ ad = new Adldap ($ settings ['connection_settings ' ], new $ settings ['connection ' ](), $ config ['auto_connect ' ]);
52+
53+ if ($ config ->get ('app.debug ' )) {
54+ // If the application is set to debug mode, we'll display LDAP error messages.
55+ $ ad ->getConnection ()->showErrors ();
56+ }
57+
58+ return $ ad ;
4959 });
5060
5161 // Bind the Adldap contract to the Adldap object
You can’t perform that action at this time.
0 commit comments