ldc-web-admin-secure-laravel/src/Console/SyncFromLdcWeb.php

43 lines
942 B
PHP

<?php
namespace Uwil\AdminSecure\Laravel\Console;
use Illuminate\Console\Command;
use Uwil\AdminSecure\Laravel\AdminSecure;
/**
* Send Report Status To LDC Web.
*
* @author Vincent BRIDIER <vincent.bridier@ldc.fr>
*/
class SyncFromLdcWeb extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'uwil:admin-secure:sync';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Sync IP list from LDC Web';
/**
* Execute the console command.
*
* @return integer
* @throws \Uwil\AdminSecure\Laravel\Exceptions\AdminSecureException If missing LDC_WEB_API_KEY key.
*/
public function handle(): int
{
$this->info($this->description);
AdminSecure::setCacheList(AdminSecure::fetchIpList());
$this->info('Done.');
return 0;
}
}