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

44 lines
947 B
PHP
Raw Normal View History

2022-06-24 18:17:20 +02:00
<?php
namespace LDC\WebAdminSecureLaravel\Console;
use Illuminate\Console\Command;
use LDC\WebAdminSecureLaravel\AdminSecure;
2022-06-24 18:17:20 +02:00
/**
* Send Report Status To LDC Web.
2023-06-02 14:46:58 +02:00
*
2022-06-24 18:17:20 +02:00
* @author Vincent BRIDIER <vincent.bridier@ldc.fr>
*/
class SyncFromLDCWeb extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'ldcweb:admin-secure-sync';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Sync IP list from LDC Web';
2022-06-24 18:17:20 +02:00
/**
* Execute the console command.
*
* @return integer
* @throws \LDC\WebAdminSecureLaravel\Exceptions\AdminSecureException If missing LDC_WEB_API_KEY key.
2022-06-24 18:17:20 +02:00
*/
2023-06-02 14:46:58 +02:00
public function handle(): int
2022-06-24 18:17:20 +02:00
{
$this->info($this->description);
AdminSecure::setCacheList(AdminSecure::fetchIpList());
2022-06-24 18:17:20 +02:00
$this->info('Done.');
return 0;
}
}