- add remove options for ip address

This commit is contained in:
Kamil Niemczycki 2023-07-27 14:03:21 +02:00
parent 58003e5d18
commit a09a75b69e
Signed by: kamilniemczycki
GPG Key ID: 04D4E2012F969213

View File

@ -0,0 +1,25 @@
<?php
declare(strict_types=1);
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Models\CVInfo;
class RemoveIPFromList extends Command
{
protected $signature = 'cv:rm-ip {ip : IP address on list.}';
protected $description = 'Remove IP address from show list.';
public function handle(): int
{
$ip = $this->argument('ip');
$cvInfo = CVInfo::query()->where('ip', $ip);
$cvInfo->delete();
$this->info('IP '. $ip .' deleted from database.');
return Command::SUCCESS;
}
}