Class · extends AbstractModel · implements SlugInterface
A product group
A product group contains one or more order-able products and determines how those products are displayed in order forms to clients.
SlugTrait
public static function boot()public function products()A product group has many products in it.
Returns \Illuminate\Database\Eloquent\Relations\HasMany
public function features()A product group can have many features.
Returns \Illuminate\Database\Eloquent\Relations\HasMany
public function scopeSlug($query, $slug)Find by slug.
Returns Builder
public function scopeNotHidden($query)Restrict to groups which are publicly visible.
Returns Builder
public function scopeSorted($query)Sort by display order.
Returns Builder
public function getRoutePath($fullUrl = false, ?int $pid = null)Get client area route path for group.
Parameters
| Type | Name | Description |
|---|---|---|
bool | $fullUrl |
Returns string
public function validateSlugIsUnique(string $slug): boolValidate slug is unique.
Parameters
| Type | Name | Description |
|---|---|---|
string | $slug |
Returns bool
public function autoGenerateUniqueSlug(): stringAuto generate unique slug based on name.
Returns string;
public function getExistingSlugCheck(string $slug): BuilderParameters
| Type | Name | Description |
|---|---|---|
string | $slug |
Returns Builder
public function orderFormTemplate()Retrieve a product group's associated order form
Use the default template if the product group doesn't have an associated order form.
Returns \WHMCS\View\Template\OrderForm
public function translatedNames()Return the translated names for the specific product
Returns \Illuminate\Database\Eloquent\Relations\HasMany\|\WHMCS\Language\DynamicTranslation[]
public function translatedHeadlines()Return the translated headlines for the specific product
Returns \Illuminate\Database\Eloquent\Relations\HasMany\|\WHMCS\Language\DynamicTranslation[]
public function translatedTaglines()Return the translated taglines for the specific product
Returns \Illuminate\Database\Eloquent\Relations\HasMany\|\WHMCS\Language\DynamicTranslation[]
public function getNameAttribute($name)Get the group's name - this will override the output from the db value if set in Lang.
Parameters
| Type | Name | Description |
|---|---|---|
string | $name | The value from the database |
Returns string
public function getHeadlineAttribute($headline)Get the group's headline - this will override the output from the db value if set in Lang.
Parameters
| Type | Name | Description |
|---|---|---|
string | $headline | The value from the database |
Returns string
public function getTaglineAttribute($tagline)Get the group's tagline - this will override the output from the db value if set in Lang.
Parameters
| Type | Name | Description |
|---|---|---|
string | $tagline | The value from the database |
Returns string
public static function getGroupName($groupId, $fallback = '', $language = null)Obtain the product group name for the current language, passed language or fallback to the currently defined value for the product group.
Parameters
| Type | Name | Description |
|---|---|---|
int | $groupId | |
string | $fallback | |
string | $language |
Returns string
public static function getHeadline($groupId, $fallback = '', $language = null)Obtain the product headline for the current language, passed language or fallback to the currently defined value for the product group.
Parameters
| Type | Name | Description |
|---|---|---|
int | $groupId | |
string | $fallback | |
string | $language |
Returns string
public static function getTagline($groupId, $fallback = '', $language = null)Obtain the product tagline for the current language, passed language or fallback to the currently defined value for the product group.
Parameters
| Type | Name | Description |
|---|---|---|
int | $groupId | |
string | $fallback | |
string | $language |
Returns string
public function isMarketConnectGroup()Returns bool
public function getMarketConnectControllerClass()Returns string
public function productSlugs()public function disallowedPaymentGateways(): Collection