# General

# What setting types are available?

As of 15/09/2026, there are ten setting types available:

<table border="1" id="bkmrk-type-description-str" style="border-collapse: collapse; width: 100%; height: 327.766px;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Type**  
</td><td style="height: 29.7969px;">**Description**  
</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">String</td><td style="height: 29.7969px;">Stores text values.</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">Boolean</td><td style="height: 29.7969px;">Stores `true`/`false` values.</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">Integer</td><td style="height: 29.7969px;">Stores whole-number values.</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">Float</td><td style="height: 29.7969px;">Stores decimal values.</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">Array</td><td style="height: 29.7969px;">Stores multiple values of different types.</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">Eloquent</td><td style="height: 29.7969px;">Stores eloquent models.</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">Encrypted</td><td style="height: 29.7969px;">Stores encrypted values.</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">Date</td><td style="height: 29.7969px;">Stores a date.</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">Date Range</td><td style="height: 29.7969px;">Stores a start and end date.</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">Cron</td><td style="height: 29.7969px;">Stores a cron expression.</td></tr></tbody></table>

---

## Base Setting

All setting types inherit the base setting which exposes the following methods.

<table border="1" id="bkmrk-method-description-m" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 50.0596%;"></col><col style="width: 50.0596%;"></col></colgroup><tbody><tr><td>**Method**  
</td><td>**Description**  
</td></tr><tr><td>`map(\Closure $map)`  
</td><td>Provide a map to format the setting value prior to retrieval.</td></tr><tr><td>`default($default)`  
</td><td>Sets the default value for the setting.</td></tr><tr><td>`section(string $section)`  
</td><td>Assigns the setting to a specific section.

</td></tr><tr><td>`label(string $label)`  
</td><td>Sets the display label for the setting.

</td></tr><tr><td>`hint(string $hint)`  
</td><td>Adds hint text for the setting.

</td></tr><tr><td>`required()`  
</td><td>Marks the setting as required.

</td></tr><tr><td>`addRule($rule)`  
</td><td>Adds a validation rule to the setting.

</td></tr><tr><td>`addRules(array $rules)`  
</td><td>Adds multiple validation rules to the setting.

</td></tr><tr><td>`removeRule($rule)`  
</td><td>Removes a validation rule from the setting.

</td></tr><tr><td>`removeRules(array $rules)`  
</td><td>Removes multiple validation rules from the setting.

</td></tr><tr><td>`showIf(string $key, $value = true)`  
</td><td>Conditionally displays the setting input based on another setting's value.

</td></tr><tr><td>`showWhen(string $key, $value = true)`  
</td><td>Alias for `showIf()`.

</td></tr></tbody></table>

---

## String Setting

String settings store text values and provide additional methods for controlling how the value is entered.

<table border="1" id="bkmrk-method-description-_" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr><td>**Method**  
</td><td>**Description**  
</td></tr><tr><td>`__construct(string $key)`  
</td><td>Creates a new string setting using the specified `$key`.</td></tr><tr><td>`textarea()`  
</td><td>Displays using a `textarea` instead of a text input.</td></tr><tr><td>`wyiswyg()`  
</td><td>Displays using a `wysiwyg` editor instead of a text input.

</td></tr></tbody></table>

<p class="callout info">String settings use the [Dropdown Rules](https://support.aerocommerce.com/books/settings/page/what-setting-types-are-available#bkmrk-dropdown-rules), [Size Rules](https://support.aerocommerce.com/books/settings/page/what-setting-types-are-available#bkmrk-size-rules) &amp; [String Rules](https://support.aerocommerce.com/books/settings/page/what-setting-types-are-available#bkmrk-string-rules) traits.</p>

### Example Usage

```php
\Aero\Common\Facades\Settings::group('acme', function (Aero\Common\Settings\SettingGroup $group) {
    // Basic
    $group->string('order_reference_prefix')->default('WEB');
    
    // Textarea
    $group->string('order_notes')->textarea();
    
    // WYSIWYG editor
    $group->string('rich_text')->wysiwyg();
    
    // Associative dropdown
    $group->string('short_date_format')->associative()
        ->in([
            'D jS M, H:i' => now()->format('D jS M, H:i'),
            'D jS M Y, H:i' => now()->format('D jS M Y, H:i'),
        ])
        ->default('D jS M, H:i')
        ->section('Date & Time');
});
```

---

## Boolean Setting

Boolean settings store `true`/`false` values and provide additional methods for controlling how multiple boolean values are handled.

<table border="1" id="bkmrk-method-description-_-1" style="border-collapse: collapse; width: 100%; height: 152.781px;"><colgroup><col style="width: 50.0596%;"></col><col style="width: 50.0596%;"></col></colgroup><tbody><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Method**  
</td><td style="height: 29.7969px;">**Description**  
</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`__construct(string $key)`  
</td><td style="height: 29.7969px;">Creates a new boolean setting using the specified `$key`.</td></tr><tr style="height: 46.5938px;"><td style="height: 46.5938px;">`onlyReturnTrueKeys()`</td><td style="height: 46.5938px;">Only return keys corresponding to `true` values (when using `multiple()`)</td></tr><tr style="height: 46.5938px;"><td style="height: 46.5938px;">`onlyReturnFalseKeys()`</td><td style="height: 46.5938px;">Only return keys corresponding to `false` values (when using `multiple()`)</td></tr></tbody></table>

<p class="callout info">Boolean settings use the [Can Have Multiple](https://support.aerocommerce.com/books/settings/page/what-setting-types-are-available#bkmrk-can-have-multiple) trait.</p>

### Example Usage

```php
\Aero\Common\Facades\Settings::group('acme', function (Aero\Common\Settings\SettingGroup $group) {
    // Basic
    $group->boolean('is_enabled')->default(true);
    
    // Multiple values
    $group->boolean('outstanding_order_states')
        ->multiple([
            \Aero\Cart\Models\OrderStatus::CANCELED => false,
            \Aero\Cart\Models\OrderStatus::ON_HOLD => true,
            \Aero\Cart\Models\OrderStatus::SUCCESSFUL => true,
            \Aero\Cart\Models\OrderStatus::COMPLETE => false,
            \Aero\Cart\Models\OrderStatus::PROCESSING => true,
            \Aero\Cart\Models\OrderStatus::CLOSED => false,
            \Aero\Cart\Models\OrderStatus::PARTIALLY_DISPATCHED => true,
            \Aero\Cart\Models\OrderStatus::DISPATCHED => false,
            \Aero\Cart\Models\OrderStatus::PARTIALLY_RETURNED => false,
            \Aero\Cart\Models\OrderStatus::RETURNED => false,
        ])
        ->onlyReturnTrueKeys();
});
```

---

## Integer Setting

Integer settings store whole-number values and provide additional methods for constraining the value and defining allowed options.

<table border="1" id="bkmrk-method-description-_-2" style="border-collapse: collapse; width: 100%; height: 59.5938px;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Method**  
</td><td style="height: 29.7969px;">**Description**  
</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`__construct(string $key)`</td><td style="height: 29.7969px;">Creates a new integer setting using the specified `$key`.</td></tr></tbody></table>

<p class="callout info">Integer settings use the [Dropdown Rules](https://support.aerocommerce.com/books/settings/page/what-setting-types-are-available#bkmrk-dropdown-rules) &amp; [Size Rules](https://support.aerocommerce.com/books/settings/page/what-setting-types-are-available#bkmrk-size-rules) traits.</p>

### Example Usage

```php
\Aero\Common\Facades\Settings::group('acme', function (Aero\Common\Settings\SettingGroup $group) {
    // Basic
    $group->integer('failed_attempts_limit')->default(5);
    
    // Dropdown
    $group->integer('per_page')
        ->in([24, 48, 96, 240, 360])
        ->default(24);
});
```

---

## Float Setting

Float settings store decimal values and provide additional methods for constraining the value and defining allowed options.

<table border="1" id="bkmrk-method-description-_-3" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr><td>**Method**  
</td><td>**Description**  
</td></tr><tr><td>`__construct(string $key)`</td><td>Creates a new float setting using the specified `$key`.</td></tr><tr><td>`step(float $step)`  
</td><td>Sets the step increment used by the float setting, uses `0.01` by default.</td></tr></tbody></table>

<p class="callout info">Float settings use the [Dropdown Rules](https://support.aerocommerce.com/books/settings/page/what-setting-types-are-available#bkmrk-dropdown-rules) &amp; [Size Rules](https://support.aerocommerce.com/books/settings/page/what-setting-types-are-available#bkmrk-size-rules) traits.</p>

### Example Usage

```php
\Aero\Common\Facades\Settings::group('acme', function (Aero\Common\Settings\SettingGroup $group) {
    // Basic
    $group->float('commission_percentage')->default(1.2)

    // Dropdown
    $group->float('fallback_tax_rate')
        ->in([0.0, 5.0, 12.5, 20.0])
        ->default(20.0);
});
```

---

## Array Setting

Array settings store arrays of values and provide additional methods for defining the structure and validation rules for each item.

<table border="1" id="bkmrk-method-description-_-4" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr><td>**Method**  
</td><td>**Description**  
</td></tr><tr><td>`__construct(string $key)`</td><td>Creates a new array setting using the specified `$key`.</td></tr><tr><td>`associative()`  
</td><td>Enables associative mode.</td></tr><tr><td>`definition(array $definition)`  
</td><td>Defines the structure and validation rules for each array item.</td></tr></tbody></table>

<p class="callout info">Array settings use the [Size Rules](https://support.aerocommerce.com/books/settings/page/what-setting-types-are-available#bkmrk-size-rules) &amp; [Can Sort](https://support.aerocommerce.com/books/settings/page/what-setting-types-are-available#bkmrk-can-sort) traits.</p>

### Example Usage

```php
\Aero\Common\Facades\Settings::group('acme', function (Aero\Common\Settings\SettingGroup $group) {
    // Basic
    $group->array('allowed_upload_types')
        ->default([
            'image/jpeg',
            'image/png',
            'image/gif',
            'image/svg+xml',
            'image/webp',
        ]);
        
    // Custom structure (each definition has a key input by default)
    $group->array('form_fields')
        ->definition([
            'type' => ['required', 'string', 'in:text,number'],
            'required' => ['boolean'],
        ])
        ->default([
            'first_name' => [
                'type' => 'text',
                'required' => true,
            ],
            'age' => [
                'type' => 'number',
                'required' => true,
            ]
        ]);
});
```

---

### Eloquent Setting

Eloquent settings store references to Eloquent models and provide additional methods for searching and sorting the results.

<table border="1" id="bkmrk-method-description-_-5" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr><td>**Method**  
</td><td>**Description**  
</td></tr><tr><td>`__construct(string $key, string $class)`</td><td>Creates a new eloquent setting using the specified `$key` for the model with class `$class`.

</td></tr><tr><td>`dontLoadModel()`  
</td><td>Disables loading the eloquent model on retrieval, returns the id instead.

</td></tr><tr><td>`dontLoadModels()`  
</td><td>Alias for `dontLoadModel()`

</td></tr><tr><td>`searchField($searchField, $displayField = null)`  
</td><td>Configures a single field to use when searching for models, with an optional field for displaying the model name.

</td></tr><tr><td>`searchFields(array $searchFields, $displayField = null)`  
</td><td>Adds one or more fields to use when searching for models and optionally sets the display field.

</td></tr></tbody></table>

<p class="callout info">Eloquent settings use the [Can Have Multiple](https://support.aerocommerce.com/books/settings/page/what-setting-types-are-available#bkmrk-can-have-multiple) &amp; [Can Sort](https://support.aerocommerce.com/books/settings/page/what-setting-types-are-available#bkmrk-can-sort) traits.</p>

### Example Usage

```php
\Aero\Common\Facades\Settings::group('acme', function (Aero\Common\Settings\SettingGroup $group) {
    // Single
    $group->eloquent('image', \Aero\Common\Models\Image::class);
        
    // Multiple
    $group->eloquent('vip_customer_groups', \Aero\Account\Models\CustomerGroup::class)->multiple();
});
```

---

## Encrypted Setting

Encrypted settings store encrypted string values and provide additional methods for constraining the value and validating its format.

<table border="1" id="bkmrk-method-description-_-6" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr><td>**Method**  
</td><td>**Description**  
</td></tr><tr><td>`__construct(string $key)`</td><td>Creates a new encrypted setting using the specified `$key`.</td></tr></tbody></table>

<p class="callout info">Encrypted settings use the [Size Rules](https://support.aerocommerce.com/books/settings/page/what-setting-types-are-available#bkmrk-size-rules) &amp; [String Rules](https://support.aerocommerce.com/books/settings/page/what-setting-types-are-available#bkmrk-string-rules) traits.</p>

### Example Usage

```php
\Aero\Common\Facades\Settings::group('acme', function (Aero\Common\Settings\SettingGroup $group) {
    $group->encrypted('api_key')->default('secret');
});
```

---

## Date Setting

Date settings store date values and provide additional methods for validating the date.

<table border="1" id="bkmrk-method-description-_-7" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr><td>**Method**  
</td><td>**Description**  
</td></tr><tr><td>`__construct(string $key)`</td><td>Creates a new date setting using the specified `$key`.</td></tr><tr><td>`beforeToday()`  
</td><td>Validates the date is in the past.</td></tr><tr><td>`beforeDate($date)`  
</td><td>Validates the date is before some specified date.</td></tr><tr><td>`afterToday()`  
</td><td>Validates the date is in the future.</td></tr><tr><td>`afterDate($date)`  
</td><td>Validates the date is after some specified date.</td></tr></tbody></table>

### Example Usage

```php
\Aero\Common\Facades\Settings::group('acme', function (Aero\Common\Settings\SettingGroup $group) {
    $group->date('today')->default('today');
});
```

---

## Date Range Setting

Date range settings store date ranges.

<table border="1" id="bkmrk-method-description-_-8" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr><td>**Method**  
</td><td>**Description**  
</td></tr><tr><td>`__construct(string $key)`</td><td>Creates a new date range setting using the specified `$key`.</td></tr></tbody></table>

### Example Usage

```php
\Aero\Common\Facades\Settings::group('acme', function (Aero\Common\Settings\SettingGroup $group) {
    $group->dateRange('available_days')->default([
        'start' => '2026-01-01 07:00:00',
        'end' => '2026-12-31 15:00:00',
    ]);
});
```

---

## Cron Setting

Cron settings store cron expressions for defining scheduled tasks.

<table border="1" id="bkmrk-method-description-_-9" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr><td>**Method**  
</td><td>**Description**  
</td></tr><tr><td>`__construct(string $key)`</td><td>Creates a new cron setting using the specified `$key`.</td></tr></tbody></table>

### Example Usage

```php
\Aero\Common\Facades\Settings::group('acme', function (Aero\Common\Settings\SettingGroup $group) {
    $group->cron('delete_old_logs')->default('0 0 * * *'); //Every day at midnight
});
```

---

## Traits

### Dropdown Rules

<table border="1" id="bkmrk-method-description-i" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr><td>**Method**  
</td><td>**Description**</td></tr><tr><td>`in($in)`  
</td><td>Defines the allowed values for the dropdown. Accepts an array of options or a closure that resolves to an array.</td></tr><tr><td>`associative()`  
</td><td>Configures the dropdown to use associative array keys as the allowed values.</td></tr></tbody></table>

<p class="callout warning">The order is important: `associative()` should be used before `in()` if required.</p>

### Size Rules

<table border="1" id="bkmrk-method-description-b" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr><td>**Method**  
</td><td>**Description**</td></tr><tr><td>`between($min, $max)`</td><td>Validates that the value is between the specified minimum and maximum values.

</td></tr><tr><td>`max($size)`  
</td><td>Validates that the value does not exceed the specified maximum size.

</td></tr><tr><td>`min($size)`  
</td><td>Validates that the value is at least the specified minimum size.

</td></tr><tr><td>`size($size)`  
</td><td>Validates that the value has exactly the specified size.

</td></tr><tr><td>`greaterThan($value)`  
</td><td>Validates that the value is greater than the specified value.

</td></tr><tr><td>`lessThan($value)`  
</td><td>Validates that the value is less than the specified value.

</td></tr></tbody></table>

### String Rules

<table border="1" id="bkmrk-method-description-e" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr><td>**Method**  
</td><td>**Description**</td></tr><tr><td>`email(string $options = 'rfc,dns')`  
</td><td>Validates the value is an email using the comma-separated values provided.</td></tr><tr><td>`uuid()`  
</td><td>Validates the value is a uuid.</td></tr><tr><td>`url()`  
</td><td>Validates the value is a url.</td></tr><tr><td>`ip()`  
</td><td>Validates the value is an ip.</td></tr><tr><td>`startsWith(string $needle)`  
</td><td>Validates the value starts with `$needle`.</td></tr><tr><td>`startsWithOneOfMany(array $needles)`  
</td><td>Validates the value starts with one of many `$needles`.</td></tr></tbody></table>

### Can Have Multiple

<table border="1" id="bkmrk-method-description-m-1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 50.0596%;"></col><col style="width: 50.0596%;"></col></colgroup><tbody><tr><td>**Method**  
</td><td>**Description**</td></tr><tr><td>`multiple(array $defaults = [])`  
</td><td>Enables multiple-value selection. Optionally sets default values and, when no options are configured, derives the available options from the default array keys.

</td></tr><tr><td>`options(array $options = [])`  
</td><td>Sets the available options.

</td></tr><tr><td>`addMultipleRules(array $rules)`  
</td><td>Adds validation rules, applied to each selected value.

</td></tr><tr><td>`addMultipleRule($rule)`  
</td><td>Adds a single validation rule, applied to each selected value.

</td></tr><tr><td>`removeMultipleRules(array $rules)`  
</td><td>Removes validation rules from being applied to each selected value.

</td></tr><tr><td>`removeMultipleRule($rule)`  
</td><td>Removes a single validation rule from being applied to each selected value.

</td></tr></tbody></table>

### Can Sort

<table border="1" id="bkmrk-method-description-s" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr><td>**Method**  
</td><td>**Description**</td></tr><tr><td>`sortable()`  
</td><td>Enables sorting for the setting.</td></tr></tbody></table>