Init
This commit is contained in:
23 files changed
+1216
No files matched your search
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Mattitja\BadIpBlocker\Console;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Mattitja\BadIpBlocker\BadIpStore;
|
||||
|
||||
class RemoveCommand extends Command
|
||||
{
|
||||
protected $signature = 'bad-ip-blocker:remove {ip : The IP address to unblock}';
|
||||
|
||||
protected $description = 'Unblock an IP address';
|
||||
|
||||
public function handle(BadIpStore $store): int
|
||||
{
|
||||
$ip = $this->argument('ip');
|
||||
|
||||
if (! $store->unblock($ip)) {
|
||||
$this->components->warn("[{$ip}] was not blocked.");
|
||||
|
||||
return self::FAILURE;
|
||||
}
|
||||
|
||||
$this->components->info("Unblocked [{$ip}].");
|
||||
|
||||
return self::SUCCESS;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user