# Defaults

> Initial table settings, protected subclass defaults, and Laravel cache configuration.

Source: https://docs.inertiax.dev/table/reference/defaults/

Override these protected static properties in a `Table` subclass, or use the corresponding fluent method for one instance. A fluent override wins over the inherited class default.

For example, configure advanced filtering with:

```php
use InertiaX\Table\Enums\FilterMode;
use InertiaX\Table\Table;

class UsersTable extends Table
{
    protected static FilterMode $defaultFilterMode = FilterMode::Advanced;
}
```

Child classes inherit this default and can override it with the same protected static property. `UsersTable::make('users')->filterMode('basic')` overrides it only for that use. An uninitialized static declaration falls back to the nearest initialized ancestor. Explicit `false`, `0`, and a nullable default’s `null` are values, not missing declarations.

## Table settings

| Property                    | Type            | Default                             | Fluent method                |
| --------------------------- | --------------- | ----------------------------------- | ---------------------------- |
| `$defaultPageSize`          | `int`           | `10`                                | `pageSize()`                 |
| `$defaultPageSizeOptions`   | `array`         | `[10, 25, 50, 100]`                 | `pageSizeOptions()`          |
| `$defaultPagination`        | `bool`          | `true`                              | `pagination()`               |
| `$defaultSorting`           | `bool`          | `true`                              | `sorting()`                  |
| `$defaultMultiSort`         | `bool`          | `true`                              | `multiSort()`                |
| `$defaultSelection`         | `bool`          | `false`                             | `selection()`                |
| `$defaultSelectionMode`     | `SelectionMode` | `SelectionMode::Multiple`           | `selectionMode()`            |
| `$defaultAutoColumns`       | `bool`          | `false`                             | `autoColumns()`              |
| `$defaultAutoColumnsExcept` | `array`         | `[]`                                | `autoColumns(except: [...])` |
| `$defaultAutoFilters`       | `bool`          | `true`                              | `autoFilters()`              |
| `$defaultFilterMode`        | `FilterMode`    | `FilterMode::Basic`                 | `filterMode()`               |
| `$defaultRefreshButton`     | `bool`          | `true`                              | `refreshButton()`            |
| `$defaultRowKey`            | `string`        | Uninitialized; inferred from source | `rowKey()`                   |

`SelectionMode` and `FilterMode` are in `InertiaX\Table\Enums`. For example, inside a subclass:

```php
protected static int $defaultPageSize = 25;
protected static bool $defaultRefreshButton = false;
```

## Column settings

Explicit column options override these table-wide defaults.

| Property                    | Type   | Default        | Fluent method         |
| --------------------------- | ------ | -------------- | --------------------- |
| `$defaultSortableColumns`   | `bool` | `false`        | `sortableColumns()`   |
| `$defaultSearchableColumns` | `bool` | `false`        | `searchableColumns()` |
| `$defaultFilterableColumns` | `bool` | `false`        | `filterableColumns()` |
| `$defaultCopyableColumns`   | `bool` | `false`        | `copyableColumns()`   |
| `$defaultToggleableColumns` | `bool` | `false`        | `toggleableColumns()` |
| `$defaultVisibleColumns`    | `bool` | `true`         | `visibleColumns()`    |
| `$defaultWrapColumns`       | `bool` | `false`        | `wrapColumns()`       |
| `$defaultTruncateColumns`   | `?int` | `0` (disabled) | `truncateColumns()`   |

When true, `$defaultSearchableColumns` follows the [table-wide search eligibility rules](https://docs.inertiax.dev/table/reference/table/#column-wide-defaults).

## Laravel package configuration

Standard setup needs no published configuration. To customize internal metadata caching:

```sh
php artisan vendor:publish --tag=inertiax-table-config
```

This creates `config/inertiax-table.php`. Its `cache` settings use the `inertiax-table.cache` configuration key:

| Setting   | Environment variable           | Default                       |
| --------- | ------------------------------ | ----------------------------- |
| `enabled` | `INERTIAX_TABLE_CACHE_ENABLED` | `true`                        |
| `store`   | `INERTIAX_TABLE_CACHE_STORE`   | Laravel’s default cache store |
| `prefix`  | `INERTIAX_TABLE_CACHE_PREFIX`  | `inertiax-table`              |
| `ttl`     | `INERTIAX_TABLE_CACHE_TTL`     | `3600` seconds                |

`cache.disable_in_local` defaults to `true`, bypassing this cache in the local environment.

## React settings

Search and filter requests share a 300 ms debounce. Set `debounceMs` on `<AppTable>` to override it. Unknown custom renderers use a diagnosed fallback unless the runtime’s `diagnostics.fallback` is `'error'`. See [Custom type diagnostics](https://docs.inertiax.dev/table/guide/registration/#diagnose-a-missing-renderer).
