# WHMCS\Config\Setting

`Class` · extends `AbstractKeyValuePair`

An individual setting stored in the tblconfiguration table.

## Constants

| Name | Description |
|  --- | --- |
| `API_NG_API_WHITELIST_APPLY` |  |
| `API_NG_API_WHITELIST` |  |
| `API_DEBUG_MODE` |  |
| `TAX_VAT_AUTO_CONFIGURATION` |  |


## Properties

| Type | Name | Description |
|  --- | --- | --- |
| `` | `$incrementing` | Settings don't have an auto-incrementing key. |
| `` | `$unique` | 'setting' is a unique column. |
| `` | `$guardedForUpdate` | Once set, we cannot change a setting's 'setting' column. |


## Methods

### boot

```php
public static function boot()
```

Load events around settings.

### allDefaults

```php
public static function allDefaults()
```

Retrieve a collection of models that each have a default value assigned

Collection will only contain models for which a default is known (via
$defaultKeyValuePairs property of the model class)

**Returns** `\Illuminate\Database\Eloquent\Collection`

### scopeUpdater

```php
public function scopeUpdater($query)
```

Retrieve all updater settings.

**Parameters**

| Type | Name | Description |
|  --- | --- | --- |
| `\Illuminate\Database\Query\Builder` | `$query` |  |


**Returns** `\Illuminate\Database\Query\Builder`

### updateRuntimeConfigCache

```php
public static function updateRuntimeConfigCache($key, $value)
```

### getValue

```php
public static function getValue($setting)
```

Retrieve a WHMCS setting value by setting key name.

Return null if the setting isn't found.

**Parameters**

| Type | Name | Description |
|  --- | --- | --- |
| `string` | `$setting` |  |


**Returns** `string\|null`

### setValue

```php
public static function setValue($key, $value)
```

Set a configuration value.

Insert the new config setting if $key doesn't exist, otherwise update the
existing $key.

**Parameters**

| Type | Name | Description |
|  --- | --- | --- |
| `string` | `$key` |  |
| `mixed` | `$value` |  |


**Returns** `Setting`

### deleteValue

```php
public static function deleteValue($key)
```

Delete a configuration value

**Parameters**

| Type | Name | Description |
|  --- | --- | --- |
| `string` | `$key` |  |


### allAsArray

```php
public static function allAsArray()
```

Retrieve all settings as a key value pair array.

**Returns** `array`

### getBooleanValues

```php
public function getBooleanValues()
```

Return the setting names whose value should be boolean, but is stored as
one of many boolean-ish strings

**Returns** `\string[]`

### getCommaSeparatedValues

```php
public function getCommaSeparatedValues()
```

Return the setting names whose value should be an array, but is stored
as a csv

**Returns** `\string[]`

### newCollection

```php
public function newCollection(array $models = array())
```

Get a collection of models

This overrides Eloquent's collection and returns one specific, and more
powerful, to the context of Setting key/value data

**Parameters**

| Type | Name | Description |
|  --- | --- | --- |
| `array` | `$models` |  |


**Returns** `\Illuminate\Database\Eloquent\Collection\|SettingCollection`