Client
Traits
Constants
STATUS_ACTIVE |
|
STATUS_INACTIVE |
|
STATUS_CLOSED |
|
PAYMENT_DATA_MIGRATED |
|
Properties summary
Type | Property | Description | |
---|---|---|---|
protected | $table | ||
protected | $columnMap | ||
$timestamps | |||
protected | $dates | ||
protected | $booleans | ||
protected | $casts | ||
$unique | |||
protected | $appends | ||
protected | $fillable | ||
$hidden |
Methods summary
Return Type | Method Name | Description | |
---|---|---|---|
users() | - | ||
usersRelation() | - | ||
getUserIds() | - | ||
User|null | owner() | Get owner. | |
HasMany | invites() | A client can have many invites. | |
HasMany|Domain | domains() | A client can have many domains. | |
HasMany|Service | services() | A client can have many services. | |
HasMany|Addon | addons() | A client can have many add-on services. | |
HasMany | contacts() | A client can have many contacts. | |
HasOne | billingContact() | - | |
HasMany | quotes() | A client can have many quotes for services. | |
HasOne | affiliate() | A client can have an associated affiliate record. | |
HasMany | invoices() | A client can have many invoices. | |
HasMany | transactions() | A client can have many transactions. | |
HasMany | remoteAccountLinks() | A client can have many linked remote accounts. | |
HasMany | orders() | A client can have many orders. | |
HasMany|Consent | marketingConsent() | - | |
HasOne | currencyrel() | A client has an associated currency. | |
Builder | scopeEmail($query, $email) | Filter by email. | |
bool | isOwnedBy(User $user) | Is client owned by a given user? | |
Stdclass | getAutheduserAttribute() deprecated | For backwards compat with six theme in v8.0.0 | |
runPostLoginEvents() | Executes post login of a client. | ||
static string[] | getStatuses() | Get client status values. | |
bool | hasDomain(string $domainName) | Determines if client has a given domain name. | |
string | generateCreditCardEncryptionKey() | Generate the AES key used to encrypt a user's credit card information. | |
Collection|Alert[] | getAlerts(AlertFactory $factory = null) | Retrieve a client's alerts. | |
array|false | isCreditCardExpiring(int $withinMonths = 2) | Determine if a user's credit card is going to expire within a number of months. | |
string | getPhoneNumberFormattedAttribute() | Returns formatted phone number. | |
getDisplayNameAttribute() | - | ||
string | getCountryNameAttribute() | Returns the human readable name for the clients country. | |
string | generateCreditCardEncryptedField(string $value) | Generate an AES Encrypted string from the passed value. | |
getUsernameAttribute() | - | ||
bool | hasSingleSignOnPermission() | Returns if the client has Single Sign-On Enabled for their account. | |
bool | isAllowedToAuthenticate() | Should the user be allowed to authenticate | |
bool | isEmailAddressVerified() | Returns if the clients' owners email address is verified. | |
updateLastLogin(Carbon $time = null, $ip = null, $host = null) | - | ||
HasMany|CustomFieldValue | customFieldValues() | - | |
getCustomFieldType() | - | ||
getCustomFieldRelId() | - | ||
bool | hasPermission(string|int $permission) | This fulfills the UserInterface | |
HasMany | tickets() | A client can have many tickets. | |
bool | isOptedInToMarketingEmails() | Determine if user is opted in to marketing emails. | |
Client | marketingEmailOptIn(string $userIp = '', bool $performCurrentSettingCheck = true) | Opt in to email marketing. | |
Client | marketingEmailOptOut(string $userIp = '', bool $performCurrentSettingCheck = true) | Opt out of email marketing. | |
Client | logActivity(string $message) | Log activity. | |
bool|null | deleteEntireClient() | Deletes a client and all associated data. | |
static | getGroups() | - | |
needsCardDetailsMigrated() | - | ||
needsBankDetailsMigrated() | - | ||
needsUnknownPaymentTokenMigrated() | - | ||
needsAnyPaymentDetailsMigrated() | - | ||
migratePaymentDetailsIfRequired($forceInCron = false) | - | ||
markCardDetailsAsMigrated() | - | ||
markBankDetailsAsMigrated() | - | ||
markPaymentTokenMigrated() | - | ||
HasMany | payMethods() | - | |
HasOne|BelongsTo | defaultBillingContact() | Return a model of the billing contact or the client itself | |
string | getGroupNameAttribute() | - | |
HasMany | domainSslStatuses() | - | |
generateUniquePlaceholderEmail() | - | ||
deleteAllCreditCards() | - | ||
static array | getUsedCardTypes() | Get the card types currently used. | |
array | buildBillingContactsArray() | - | |
PayMethodInterface | createRemoteCardPayMethod(string|Gateway $gateway, string $cardNumber, string $cardExpiryDate, string $remoteToken, string|integer $billingContactId = 'billing', string $description = '', null|string $cardType = null, null|string $cardStartDate = null, null|string $cardIssueNumber = null) | - | |
PayMethodInterface | createCardPayMethod(string $cardNumber, string $cardExpiryDate, string|integer $billingContactId = 'billing', string $description = '', null|string $cardType = null, null|string $cardStartDate = null, null|string $cardIssueNumber = null) | - | |
PayMethodInterface | createBankPayMethod(string $accountType, string $routingNumber, string $accountNumber, string $bankName, string $accountHolderName, string|integer $billingContactId = 'billing', string $description = '') | - | |
PayMethodInterface | createRemoteBankPayMethod(string|Gateway $gateway, string $remoteToken, string $accountNumber = '', string $accountHolderName = '', string|integer $billingContactId = 'billing', string $description = '') | - | |
float | getClientDiscountPercentage() | Get client discount percentage. | |
Client | addCredit(string $description, float $amount) | Add a credit + credit log entry. | |
getLink() | - | ||
authedUserIsOwner() | - | ||
getAuthUserById($userId) | - | ||
string | getCurrencyCodeAttribute() | - | |
Client | mergeTo(Client $client) | - | |
void | deleteUsersWithNoOtherClientAccounts() | Delete all users related to this account that have no relationship to any other account. | |
void | deleteTransactions() | Delete all transactions belonging to this account | |
void | disassociateTransactions() | Disassociate all transactions from this account. |
Details
users ()
usersRelation ()
getUserIds ()
User|null
owner ()
Get owner.
HasMany
invites ()
A client can have many invites.
HasMany|Domain
domains ()
A client can have many domains.
HasMany|Service
services ()
A client can have many services.
HasMany|Addon
addons ()
A client can have many add-on services.
HasMany
contacts ()
A client can have many contacts.
HasOne
billingContact ()
HasMany
quotes ()
A client can have many quotes for services.
HasOne
affiliate ()
A client can have an associated affiliate record.
HasMany
invoices ()
A client can have many invoices.
HasMany
transactions ()
A client can have many transactions.
HasMany
remoteAccountLinks ()
A client can have many linked remote accounts.
NB: this will not return remote auth links of contacts associated with the client.
HasMany
orders ()
A client can have many orders.
HasMany|Consent
marketingConsent ()
HasOne
currencyrel ()
A client has an associated currency.
Named currencyrel
because the name currency
conflicts with field name.
Builder
scopeEmail ($query, $email)
Filter by email.
bool
isOwnedBy (User $user)
Is client owned by a given user?
Stdclass
getAutheduserAttribute ()
deprecated
deprecated
For backwards compat with six theme in v8.0.0
runPostLoginEvents ()
Executes post login of a client.
static string[]
getStatuses ()
Get client status values.
bool
hasDomain (string $domainName)
Determines if client has a given domain name.
Checks for both domains associated to services as well as domain registrations.
protected string
generateCreditCardEncryptionKey ()
Generate the AES key used to encrypt a user's credit card information.
Collection|Alert[]
getAlerts (AlertFactory $factory = null)
Retrieve a client's alerts.
array|false
isCreditCardExpiring (int $withinMonths = 2)
Determine if a user's credit card is going to expire within a number of months.
string
getPhoneNumberFormattedAttribute ()
Returns formatted phone number.
If PhoneNumberDropdown setting enabled, then phone number will be formatted to be digestable by jackocnr/intl-tel-input script used.
getDisplayNameAttribute ()
string
getCountryNameAttribute ()
Returns the human readable name for the clients country.
string
generateCreditCardEncryptedField (string $value)
Generate an AES Encrypted string from the passed value.
getUsernameAttribute ()
bool
hasSingleSignOnPermission ()
Returns if the client has Single Sign-On Enabled for their account.
bool
isAllowedToAuthenticate ()
Should the user be allowed to authenticate
bool
isEmailAddressVerified ()
Returns if the clients' owners email address is verified.
updateLastLogin (Carbon $time = null, $ip = null, $host = null)
HasMany|CustomFieldValue
customFieldValues ()
protected
getCustomFieldType ()
protected
getCustomFieldRelId ()
bool
hasPermission (string|int $permission)
This fulfills the UserInterface
HasMany
tickets ()
A client can have many tickets.
bool
isOptedInToMarketingEmails ()
Determine if user is opted in to marketing emails.
Client
marketingEmailOptIn (string $userIp = '', bool $performCurrentSettingCheck = true)
Opt in to email marketing.
Client
marketingEmailOptOut (string $userIp = '', bool $performCurrentSettingCheck = true)
Opt out of email marketing.
Client
logActivity (string $message)
Log activity.
bool|null
deleteEntireClient ()
Deletes a client and all associated data.
static
getGroups ()
needsCardDetailsMigrated ()
needsBankDetailsMigrated ()
needsUnknownPaymentTokenMigrated ()
needsAnyPaymentDetailsMigrated ()
migratePaymentDetailsIfRequired ($forceInCron = false)
markCardDetailsAsMigrated ()
markBankDetailsAsMigrated ()
markPaymentTokenMigrated ()
HasMany
payMethods ()
HasOne|BelongsTo
defaultBillingContact ()
Return a model of the billing contact or the client itself
This is determined by a value set against billingcid.
string
getGroupNameAttribute ()
HasMany
domainSslStatuses ()
generateUniquePlaceholderEmail ()
deleteAllCreditCards ()
static array
getUsedCardTypes ()
Get the card types currently used.
array
buildBillingContactsArray ()
PayMethodInterface
createRemoteCardPayMethod (string|Gateway $gateway, string $cardNumber, string $cardExpiryDate, string $remoteToken, string|integer $billingContactId = 'billing', string $description = '', null|string $cardType = null, null|string $cardStartDate = null, null|string $cardIssueNumber = null)
PayMethodInterface
createCardPayMethod (string $cardNumber, string $cardExpiryDate, string|integer $billingContactId = 'billing', string $description = '', null|string $cardType = null, null|string $cardStartDate = null, null|string $cardIssueNumber = null)
PayMethodInterface
createBankPayMethod (string $accountType, string $routingNumber, string $accountNumber, string $bankName, string $accountHolderName, string|integer $billingContactId = 'billing', string $description = '')
PayMethodInterface
createRemoteBankPayMethod (string|Gateway $gateway, string $remoteToken, string $accountNumber = '', string $accountHolderName = '', string|integer $billingContactId = 'billing', string $description = '')
float
getClientDiscountPercentage ()
Get client discount percentage.
Client
addCredit (string $description, float $amount)
Add a credit + credit log entry.
getLink ()
authedUserIsOwner ()
getAuthUserById ($userId)
string
getCurrencyCodeAttribute ()
void
deleteUsersWithNoOtherClientAccounts ()
Delete all users related to this account that have no relationship to any other account.
This should only be called when deleting a client account.
void
deleteTransactions ()
Delete all transactions belonging to this account
void
disassociateTransactions ()
Disassociate all transactions from this account.
This removes the account association and sets the currency id to match the current from this account.