This repository was archived by the owner on Jul 24, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +17
-15
lines changed
Expand file tree Collapse file tree 2 files changed +17
-15
lines changed Original file line number Diff line number Diff line change @@ -25,19 +25,21 @@ class AdldapAuthServiceProvider extends ServiceProvider
2525 */
2626 public function boot ()
2727 {
28- $ config = __DIR__ .'/Config/auth.php ' ;
29-
30- $ this ->publishes ([
31- $ config => config_path ('ldap_auth.php ' ),
32- ]);
33-
3428 // Register the lDAP auth provider.
3529 Auth::provider ('ldap ' , function ($ app , array $ config ) {
3630 return $ this ->makeUserProvider ($ app ['hash ' ], $ config );
3731 });
3832
39- // Register the import command.
40- $ this ->commands (Import::class);
33+ if ($ this ->app ->runningInConsole ()) {
34+ $ config = __DIR__ . '/Config/auth.php ' ;
35+
36+ $ this ->publishes ([
37+ $ config => config_path ('ldap_auth.php ' ),
38+ ]);
39+
40+ // Register the import command.
41+ $ this ->commands (Import::class);
42+ }
4143 }
4244
4345 /**
Original file line number Diff line number Diff line change @@ -36,11 +36,13 @@ public function boot()
3636 return ;
3737 }
3838
39- $ config = __DIR__ .'/Config/config.php ' ;
39+ if ($ this ->app ->runningInConsole ()) {
40+ $ config = __DIR__ . '/Config/config.php ' ;
4041
41- $ this ->publishes ([
42- $ config => config_path ('ldap.php ' ),
43- ]);
42+ $ this ->publishes ([
43+ $ config => config_path ('ldap.php ' ),
44+ ]);
45+ }
4446 }
4547
4648 /**
@@ -73,9 +75,7 @@ public function register()
7375 */
7476 public function provides ()
7577 {
76- return [
77- AdldapInterface::class,
78- ];
78+ return [AdldapInterface::class];
7979 }
8080
8181 /**
You can’t perform that action at this time.
0 commit comments