Skip to content

Commit

Permalink
serviceprovider update
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulalam31 committed Aug 20, 2024
1 parent 6b9eec9 commit c258ff9
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions src/AbuseIPServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,36 @@

class AbuseIPServiceProvider extends ServiceProvider
{
/**
* The config source path.
*
* @var string
*/
protected $config = __DIR__ . '/../config/abuseip.php';

public function boot()
{
$this->publishes([
__DIR__.'/../config/abuseip.php' => config_path('abuseip.php'),
__DIR__ . '/../config/abuseip.php' => config_path('abuseip.php'),
], 'laravel-abuse-ip');

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

$this->mergeConfigFrom(
__DIR__.'/../config/abuseip.php', 'abuseip'
);

if($this->app->runningInConsole()){
if ($this->app->runningInConsole()) {
$this->commands([
UpdateAbuseIps::class,
]);
}

$this->app['router']->aliasMiddleware('abuse_ip', AbuseIp::class);


}

public function register()
{

// $this->mergeConfigFrom(
// __DIR__.'/../config/abuseip.php', 'abuseip'
// );
$this->mergeConfigFrom($this->config, 'abuseip');
// $this->app['router']->aliasMiddleware('block.abuse_ip', \RApp\Http\Middleware\AbuseIp::class);
}

}

0 comments on commit c258ff9

Please sign in to comment.