update email template
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands\Whmcs;
|
||||
|
||||
use App\Integrations\Whmcs\Extractors\CustomerDomainExtractor;
|
||||
use App\Integrations\Whmcs\Transformers\CustomerDomainTransformer;
|
||||
use App\Integrations\Whmcs\Writers\CustomerDomainWriter;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class SyncCustomerDomainsCommand extends Command
|
||||
{
|
||||
protected $signature = 'whmcs:sync-domains';
|
||||
|
||||
protected $description = 'Extract customer domain registrations (tbldomains) from WHMCS and upsert them into module_domain (run after whmcs:sync-clients, whmcs:sync-orders, domain:sync)';
|
||||
|
||||
public function handle(CustomerDomainExtractor $extractor, CustomerDomainTransformer $transformer, CustomerDomainWriter $writer): int
|
||||
{
|
||||
$total = DB::connection('whmcs')->table('tbldomains')->count();
|
||||
|
||||
$bar = $this->output->createProgressBar($total);
|
||||
$bar->start();
|
||||
|
||||
$skipped = 0;
|
||||
foreach ($extractor->extract() as $row) {
|
||||
if (! $writer->write($transformer->transform($row))) {
|
||||
$skipped++;
|
||||
}
|
||||
$bar->advance();
|
||||
}
|
||||
|
||||
$bar->finish();
|
||||
$this->newLine();
|
||||
$this->info("Processed {$total} domain(s), skipped {$skipped} (unresolved customer).");
|
||||
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user