Files
bad-ip-blocker/src/Console/RemoveCommand.php
T
2026-11-11 23:19:20 +01:00

29 lines
637 B
PHP

<?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;
}
}