File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -52,16 +52,31 @@ public function register()
52
52
'visits '
53
53
);
54
54
55
+
55
56
// Register GeoIP service provider if not already registered
56
57
if (!$ this ->app ->providerIsLoaded (GeoIPServiceProvider::class)) {
57
58
$ this ->app ->register (GeoIPServiceProvider::class);
58
59
}
59
-
60
+
60
61
// Register GeoIP facade if not already registered
61
- if ($ this ->app ->getAlias ('GeoIP ' ) === null ) {
62
+ $ geoipAlias = $ this ->app ->getAlias ('GeoIP ' );
63
+ if ($ geoipAlias === null ) {
62
64
$ this ->app ->alias ('GeoIP ' , \Torann \GeoIP \Facades \GeoIP::class);
63
65
}
64
66
67
+ // Make sure GeoIP has a configuration
68
+ if (!file_exists (config_path ('geoip.php ' ))) {
69
+ $ this ->publishes ([
70
+ __DIR__ .'/config/geoip.php ' => config_path ('geoip.php ' ),
71
+ ], 'config ' );
72
+
73
+ // Force merge the config in the current request
74
+ $ this ->mergeConfigFrom (
75
+ __DIR__ .'/config/geoip.php ' ,
76
+ 'geoip '
77
+ );
78
+ }
79
+
65
80
$ this ->app ->bind ('command.visits:clean ' , CleanCommand::class);
66
81
67
82
$ this ->commands ([
You can’t perform that action at this time.
0 commit comments