Class · extends AbstractModel · implements ServiceInterface, InvoicingServiceInterface, SubscriptionAwareInterface, ServicePricingInterface
Service addons
Please note that "Service Addons" are completely separate from "WHMCS Addons," which add functionality to WHMCS.
A service Addon allows the operator of WHMCS to provide additional services which are conditional to the purchase of a parent Service, such as additional disk space or other similar services.
This object is an instance of a service addon, including the fees and cycles configured in the Order which purchased this addon.
DomainTraitsProvisioningTraitsSubscriptionAwareTrait
public function getServiceActual(): Servicepublic function getServiceSurrogate(): Servicepublic function hasServiceSurrogate(): boolpublic function getServiceClient(): Clientpublic function getServiceProperties(): Propertiespublic static function boot()public function scopeUserId(Builder $query, $userId)Parameters
| Type | Name | Description |
|---|---|---|
Builder | $query | |
int | $userId |
Returns Builder
public function scopeOfService(Builder $query, $serviceId)Parameters
| Type | Name | Description |
|---|---|---|
Builder | $query | |
integer | $serviceId |
Returns Builder
public function scopeActive(Builder $query)Parameters
| Type | Name | Description |
|---|---|---|
Builder | $query |
Returns Builder
public function scopeMarketConnect(Builder $query)Filter for only MarketConnect addon services.
Parameters
| Type | Name | Description |
|---|---|---|
Builder | $query |
Returns Builder
public function scopeIsConsideredActive(Builder $query)Parameters
| Type | Name | Description |
|---|---|---|
Builder | $query |
Returns Builder
public function scopeIsNotRecurring($query)Parameters
| Type | Name | Description |
|---|---|---|
Builder | $query |
Returns Builder
public function service()Each addon belongs to one service.
Returns \Illuminate\Database\Eloquent\Relations\BelongsTo
public function productAddon()Each addon belongs to a single product addon.
Returns \Illuminate\Database\Eloquent\Relations\BelongsTo
public function client()Each addon belongs to one client.
Returns \Illuminate\Database\Eloquent\Relations\BelongsTo
public function customFieldValues()Returns HasMany\|CustomFieldValue
public static function getNonTerminalStatuses(): arrayStatus values representative of an entry that has further status values it could transition to.
Returns string[] — Array of Statuses as strings
public function order()An addon belongs to a single order.
Returns BelongsTo
public function paymentGateway()Each addon has many payment gateway records.
Returns \Illuminate\Database\Eloquent\Relations\HasMany
public function getServicePropertiesAttribute()Returns Properties
public function ssl()Each addon could have many ssl records.
Returns \Illuminate\Database\Eloquent\Relations\HasMany
public function invoices(): BelongsToManypublic function canBeUpgraded()Determine if addon can be upgraded.
Returns bool
public function isService()Is this entity a service?
Returns bool
public function isAddon()Is this entity an addon?
Returns bool
public function serverModel()Returns \Illuminate\Database\Eloquent\Relations\HasOne
public function failedActions()Returns HasMany
public function moduleConfiguration()Returns HasMany
public function legacyProvision()Run provision action in legacy mode.
Legacy mode returns 'success' on success and an error message string on failure.
Returns string
public function isProrated(): boolpublic function isRecurring(): boolReturns bool
public function isFree(): boolReturns bool
public function getLink()public function recalculateRecurringPrice(): floatpublic function getProvisioningTypeAttribute(): stringReturns string
public function getFirstPaymentAmount(): FormatterPricepublic function getRecurringAmount(): FormatterPricepublic function getBillingCycle(): stringpublic function getPaymentGateway(): Gatewaypublic function getNextDueDate(): ?Carbonpublic function getPromotions(): SupportCollectionService's addon does not support promotion at this time but need to return empty collection to meet interface's requirements
Returns SupportCollection
public function getServiceProduct(): ?AddonInterfaceReturns the associated predefined Addon or an AdHoc addon if the product addon is null
Returns AddonInterface\|null
public function getInvoicingServiceItemType(): stringpublic function getInvoicingServiceFirstPaymentAmount(): FormatterPricepublic function getInvoicingServiceRecurringAmount(): FormatterPricepublic function isServiceMetricUsage(): boolAddon does not support Usage billing at this time
Returns bool