Skip to content

Commit c258ff9

Browse files
committed
serviceprovider update
1 parent 6b9eec9 commit c258ff9

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

Diff for: src/AbuseIPServiceProvider.php

+11-13
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,36 @@
88

99
class AbuseIPServiceProvider extends ServiceProvider
1010
{
11+
/**
12+
* The config source path.
13+
*
14+
* @var string
15+
*/
16+
protected $config = __DIR__ . '/../config/abuseip.php';
17+
1118
public function boot()
1219
{
1320
$this->publishes([
14-
__DIR__.'/../config/abuseip.php' => config_path('abuseip.php'),
21+
__DIR__ . '/../config/abuseip.php' => config_path('abuseip.php'),
1522
], 'laravel-abuse-ip');
1623

1724
$this->publishes([
18-
__DIR__.'/../abuseip.json' => storage_path('framework/abuseip.json'),
25+
__DIR__ . '/../abuseip.json' => config('abuseip.storage'),
1926
], 'laravel-abuse-ip');
2027

21-
$this->mergeConfigFrom(
22-
__DIR__.'/../config/abuseip.php', 'abuseip'
23-
);
24-
25-
if($this->app->runningInConsole()){
28+
if ($this->app->runningInConsole()) {
2629
$this->commands([
2730
UpdateAbuseIps::class,
2831
]);
2932
}
3033

3134
$this->app['router']->aliasMiddleware('abuse_ip', AbuseIp::class);
32-
33-
3435
}
3536

3637
public function register()
3738
{
3839

39-
// $this->mergeConfigFrom(
40-
// __DIR__.'/../config/abuseip.php', 'abuseip'
41-
// );
40+
$this->mergeConfigFrom($this->config, 'abuseip');
4241
// $this->app['router']->aliasMiddleware('block.abuse_ip', \RApp\Http\Middleware\AbuseIp::class);
4342
}
44-
4543
}

0 commit comments

Comments
 (0)