# 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

```php
public function parentCategory()
```

A category may have a parent category.

**Returns** `\Illuminate\Database\Eloquent\Relations\HasOne`

### childCategories

```php
public function childCategories()
```

A category may have many child categories.

**Returns** `\Illuminate\Database\Eloquent\Relations\HasMany`

### downloads

```php
public function downloads()
```

A download category may have many downloads in it.

**Returns** `\Illuminate\Database\Eloquent\Relations\HasMany`

### scopeOfParent

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

Scopes model for children categories for $parentId

**Parameters**

| Type | Name | Description |
|  --- | --- | --- |
| `Builder` | `$query` |  |
| `int` | `$parentId` |  |


**Returns** `Builder`

### scopeVisible

```php
public function scopeVisible(Builder $query)
```

Scopes model to return visible categories only

**Parameters**

| Type | Name | Description |
|  --- | --- | --- |
| `Builder` | `$query` |  |


**Returns** `Builder`