- add remove options for ip address
This commit is contained in:
parent
58003e5d18
commit
a09a75b69e
25
app/Console/Commands/RemoveIPFromList.php
Normal file
25
app/Console/Commands/RemoveIPFromList.php
Normal 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;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user