Skip to content
Last updated

WHMCS\Download\Category

Class · extends AbstractModel

A download category

All files available for download in WHMCS must be within at least one Category. Files may exist within multiple Categories. Categories may also contain other Categories. If a Category is hidden, all files within that Category will be hidden throughout the user interface (even those files exist in visible categories).

Methods

parentCategory

public function parentCategory()

A category may have a parent category.

Returns \Illuminate\Database\Eloquent\Relations\HasOne

childCategories

public function childCategories()

A category may have many child categories.

Returns \Illuminate\Database\Eloquent\Relations\HasMany

downloads

public function downloads()

A download category may have many downloads in it.

Returns \Illuminate\Database\Eloquent\Relations\HasMany

scopeOfParent

public function scopeOfParent(Builder $query, $parentId = 0)

Scopes model for children categories for $parentId

Parameters

TypeNameDescription
Builder$query
int$parentId

Returns Builder

scopeVisible

public function scopeVisible(Builder $query)

Scopes model to return visible categories only

Parameters

TypeNameDescription
Builder$query

Returns Builder