21 lines
663 B
PHP
21 lines
663 B
PHP
<?php
|
|
|
|
namespace Modules\Licensing\Console;
|
|
|
|
use Modules\Licensing\Services\LicenseDeliveryService;
|
|
use Illuminate\Console\Command;
|
|
|
|
final class SonarDeskLicenseDeliver extends Command
|
|
{
|
|
protected $signature = 'sonardesk:license-deliver {--limit=50 : Maximum pending licence emails to send}';
|
|
protected $description = 'Deliver pending SonarDesk licence-key emails';
|
|
|
|
public function handle(LicenseDeliveryService $delivery): int
|
|
{
|
|
$limit = max(1, min((int) $this->option('limit'), 100));
|
|
$count = $delivery->deliverPending($limit);
|
|
$this->info("Delivered {$count} licence email(s).");
|
|
return self::SUCCESS;
|
|
}
|
|
}
|