Documentation

AccountService
in package

Table of Contents

$searchableFields  : array<string|int, mixed>
fetchByUserId()  : LengthAwarePaginator
Retrieves all WHMCS Clients (aka Account) related to the specified User a WHMCS User can handle many Client
fetchOne()  : Account
Retrieves the whmcs client (aka account) related to the specified id or email
find()  : LengthAwarePaginator
Retrieves a filtered list of account. The searchable fields are stored in the `filterableFields` property
compileSelect()  : Builder
Prepare the select statement

Properties

$searchableFields

private array<string|int, mixed> $searchableFields = ['id' => 'tblclients.id', 'first_name' => 'tblclients.firstname', 'last_name' => 'tblclients.lastname', 'email' => 'tblclients.email', 'country' => 'tblclients.country']

searchable fields accepted in the request, translated to raw database field

Methods

fetchByUserId()

Retrieves all WHMCS Clients (aka Account) related to the specified User a WHMCS User can handle many Client

public fetchByUserId(int $id) : LengthAwarePaginator
Parameters
$id : int

the related user id of the account

Return values
LengthAwarePaginator —

paginated result of the query

fetchOne()

Retrieves the whmcs client (aka account) related to the specified id or email

public fetchOne(int|string $idOrEmail) : Account
Parameters
$idOrEmail : int|string

whmcs client id or email

Return values
Account —

the account object

find()

Retrieves a filtered list of account. The searchable fields are stored in the `filterableFields` property

public find([array<string|int, mixed> $criteria = [] ]) : LengthAwarePaginator
Parameters
$criteria : array<string|int, mixed> = []

associative array of field and value

Return values
LengthAwarePaginator —

a paginated result

compileSelect()

Prepare the select statement

private compileSelect() : Builder
Return values
Builder —

query builder instance

Search results