Skip to content

Commit 71faf9f

Browse files
committed
Allow to disable and change cron to unlockip command
1 parent 601f3b4 commit 71faf9f

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/Config/firewall.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
// 'ip' => '\App\Models\YourIpModel',
1313
],
1414

15+
'unblockip_cron' => [
16+
'enabled' => boolval(env('FIREWALL_UNBLOCKIP_ENABLED', true)),
17+
'cron' => env('FIREWALL_UNBLOCKIP_CRON', '* * * * *'),
18+
],
1519
'responses' => [
1620

1721
'block' => [

src/Provider.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,12 @@ public function registerCommands()
106106
{
107107
$this->commands(UnblockIp::class);
108108

109-
$this->app->booted(function () {
110-
app(Schedule::class)->command('firewall:unblockip')->everyMinute();
111-
});
109+
if (config('firewall.unblockip_cron.enabled', true)) {
110+
$this->app->booted(function () {
111+
app(Schedule::class)
112+
->command('firewall:unblockip')
113+
->cron(config('firewall.unblockip_cron.cron', '* * * * *'));
114+
});
115+
}
112116
}
113117
}

0 commit comments

Comments
 (0)