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()
36
36
{
37
37
// Bind the Adldap instance to the IoC
38
38
$ this ->app ->bind ('adldap ' , function () {
39
- $ config = $ this ->app ['config ' ]->get ('adldap ' );
39
+ $ config = $ this ->app ['config ' ];
40
+
41
+ $ settings = $ config ->get ('adldap ' );
40
42
41
43
// Verify configuration.
42
- if (is_null ($ config )) {
44
+ if (is_null ($ settings )) {
43
45
$ message = 'Adldap configuration could not be found. Try re-publishing using `php artisan vendor:publish --tag="adldap"`. ' ;
44
46
45
47
throw new ConfigurationMissingException ($ message );
46
48
}
47
49
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 ;
49
59
});
50
60
51
61
// Bind the Adldap contract to the Adldap object
You can’t perform that action at this time.
0 commit comments