Skip to content

Commit afc82d0

Browse files
authored
..
1 parent f381350 commit afc82d0

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

src/VisitsServiceProvider.php

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ public function register()
5252
'visits'
5353
);
5454

55+
// Mock implementation
56+
if ($this->app->environment('testing')) {
57+
$this->mergeConfigFrom(
58+
__DIR__.'/config/geoip.php',
59+
'visits'
60+
);
61+
}
5562

5663
// Register GeoIP service provider if not already registered
5764
if (!$this->app->providerIsLoaded(GeoIPServiceProvider::class)) {
@@ -64,19 +71,6 @@ public function register()
6471
$this->app->alias('GeoIP', \Torann\GeoIP\Facades\GeoIP::class);
6572
}
6673

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-
8074
$this->app->bind('command.visits:clean', CleanCommand::class);
8175

8276
$this->commands([

src/config/geoip.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
|
3737
*/
3838

39-
'service' => null,
39+
'service' => 'ipdata',
4040

4141
/*
4242
|--------------------------------------------------------------------------

0 commit comments

Comments
 (0)