update email template
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Integrations\Whmcs\Extractors;
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\LazyCollection;
|
||||
|
||||
class AddonExtractor
|
||||
{
|
||||
public function extract(): LazyCollection
|
||||
{
|
||||
return DB::connection('whmcs')->table('tbladdons')->orderBy('id')->cursor();
|
||||
}
|
||||
|
||||
/** tblpricing row for this addon, if any (type='addon'). */
|
||||
public function pricing(int $addonId): ?object
|
||||
{
|
||||
return DB::connection('whmcs')->table('tblpricing')
|
||||
->where('type', 'addon')
|
||||
->where('relid', $addonId)
|
||||
->first();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Integrations\Whmcs\Extractors;
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\LazyCollection;
|
||||
|
||||
class ClientExtractor
|
||||
{
|
||||
public function extract(): LazyCollection
|
||||
{
|
||||
return DB::connection('whmcs')->table('tblclients')->orderBy('id')->cursor();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Integrations\Whmcs\Extractors;
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\LazyCollection;
|
||||
|
||||
class CustomerDomainExtractor
|
||||
{
|
||||
public function extract(): LazyCollection
|
||||
{
|
||||
return DB::connection('whmcs')->table('tbldomains')->orderBy('id')->cursor();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Integrations\Whmcs\Extractors;
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\LazyCollection;
|
||||
|
||||
class InvoiceExtractor
|
||||
{
|
||||
public function extract(): LazyCollection
|
||||
{
|
||||
return DB::connection('whmcs')->table('tblinvoices')->orderBy('id')->cursor();
|
||||
}
|
||||
|
||||
/**
|
||||
* Line items for a single invoice (tblinvoiceitems has no per-invoice cursor of its own,
|
||||
* items are pulled per-invoice while its job runs).
|
||||
*/
|
||||
public function items(int $invoiceId): \Illuminate\Support\Collection
|
||||
{
|
||||
return DB::connection('whmcs')->table('tblinvoiceitems')->where('invoiceid', $invoiceId)->get();
|
||||
}
|
||||
|
||||
public function orderIdFor(int $invoiceId): ?int
|
||||
{
|
||||
return DB::connection('whmcs')->table('tblorders')->where('invoiceid', $invoiceId)->value('id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Integrations\Whmcs\Extractors;
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\LazyCollection;
|
||||
|
||||
class OrderExtractor
|
||||
{
|
||||
public function extract(): LazyCollection
|
||||
{
|
||||
return DB::connection('whmcs')->table('tblorders')->orderBy('id')->cursor();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Integrations\Whmcs\Extractors;
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\LazyCollection;
|
||||
|
||||
class OrderItemExtractor
|
||||
{
|
||||
/**
|
||||
* Each `tblhosting` row (a provisioned service instance) is the closest WHMCS equivalent
|
||||
* of an order line item — WHMCS orders have no real line-item table of their own.
|
||||
*/
|
||||
public function extract(): LazyCollection
|
||||
{
|
||||
return DB::connection('whmcs')->table('tblhosting')->orderBy('id')->cursor();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Integrations\Whmcs\Extractors;
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\LazyCollection;
|
||||
|
||||
class ProductExtractor
|
||||
{
|
||||
public function extract(): LazyCollection
|
||||
{
|
||||
return DB::connection('whmcs')->table('tblproducts')->orderBy('id')->cursor();
|
||||
}
|
||||
|
||||
/** tblpricing row for this product, if any (type='product'). */
|
||||
public function pricing(int $productId): ?object
|
||||
{
|
||||
return DB::connection('whmcs')->table('tblpricing')
|
||||
->where('type', 'product')
|
||||
->where('relid', $productId)
|
||||
->first();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Integrations\Whmcs\Extractors;
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\LazyCollection;
|
||||
|
||||
class ProductGroupExtractor
|
||||
{
|
||||
public function extract(): LazyCollection
|
||||
{
|
||||
return DB::connection('whmcs')->table('tblproductgroups')->orderBy('id')->cursor();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Integrations\Whmcs\Extractors;
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\LazyCollection;
|
||||
|
||||
class ServiceExtractor
|
||||
{
|
||||
public function extract(): LazyCollection
|
||||
{
|
||||
return DB::connection('whmcs')->table('tblhosting')->orderBy('id')->cursor();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user