PowerGrid Configuration Options โ
Publish the file, then edit config/livewire-powergrid.php.
php artisan vendor:publish --tag=livewire-powergrid-configBase JS/CSS setup is in Configure PowerGrid.
Core Settings โ
UI Theme โ
Themes: Tailwind (default), DaisyUI, and Flux. Value is a registered name or an FQCN.
'theme' => 'tailwind',
// 'theme' => 'daisyui',
// 'theme' => 'flux',
// 'theme' => \PowerComponents\LivewirePowerGrid\Themes\Tailwind::class,Register a custom name with PowerGridManager::registerTheme(). See Custom Theme.
Theme Overrides โ
Restyle any token without a Theme class. Merged last, highest precedence.
'theme_overrides' => [
'table' => [
'layout' => [
'th' => 'font-bold px-4 py-3',
],
],
],Max Per Page โ
Upper bound for rows fetched per page. The per-page value travels in component state, so this ceiling keeps one request from loading an unbounded number of rows. Set to 0 to disable.
'max_per_page' => 1000,Escape Closure Fields โ
Strings returned by fields() closures are escaped; return Illuminate\Support\HtmlString for fields that must render markup. Set to false to render closure strings as raw HTML (v6 behavior) and escape user data yourself. Fields added without a closure are always escaped.
'escape_closure_fields' => true,Persist Driver โ
Persist State saves columns, sorting, and filters.
| Driver | Description |
|---|---|
cookies | Store data in cookies (default). |
session | Store data in the session. |
cache | Store data in the cache. |
'persist_driver' => 'cookies',
'persist_driver_store' => null, // not in the published file; add it when neededWhen the driver is cache, set persist_driver_store to a cache store name (empty uses the default store). Any other driver value throws Invalid persist driver.
Filter Position โ
Global placement for Filters.
| Filter | Placement |
|---|---|
inline | Filters inside the table (live, debounced) |
dropdown | Popover anchored to a Filter button. Edits stay in a draft until Apply. |
flyout | Drawer sliding from a side edge. Edits stay in a draft until Apply. |
null | No filter UI |
'filter' => 'flyout',When filter is flyout:
'filter_flyout' => [
'position' => 'right', // left or right
'close_on_escape' => true,
'close_on_click_outside' => true,
],Per-table position: Filter Position. The v6 value outside is gone; use dropdown or flyout.
Filter Wire โ
filter_wire sets the Livewire modifier chain on each filter control. Applied to wire:model โ live.debounce.600ms, live, blur, lazy, or '' when a JavaScript widget pushes its own update.
Slots: value, operator, start, end, formatted. Only the entries you set are overridden. Defaults from Support\FilterWire:
| Filter type | Slots | Default |
|---|---|---|
input_text | value, operator | live.debounce.600ms |
number | start, end | live.debounce.600ms |
select | value | live |
boolean | value | live |
multi_select | value | '' |
date | formatted | '' |
datetime | formatted | '' |
'filter_wire' => [
// 'input_text' => ['value' => 'live.debounce.800ms'],
],A single grid overrides the same map with filterWire(). That array is merged on top of this config.
public function filterWire(): array
{
return [
'input_text' => ['value' => 'live.debounce.800ms'],
];
}A slot name outside those five throws InvalidArgumentException. Keys for filter types not listed above are ignored.
Cache TTL โ
TTL in seconds for cached action-rule resolution. null or 0 disables it (default).
Note: This key only affects action-rule caching. Query cache TTL is set per table with
PowerGrid::cache()->ttl()(default 300 seconds). See Cache.
'cache_ttl' => null,Third-party Integrations โ
OpenSpout โ
Exports use OpenSpout v5, which is not installed with PowerGrid. Run composer require openspout/openspout:^5.0 (see Exporting Data).
'exportable' => [
'default' => 'openspout_v5',
'openspout_v5' => [
'xlsx' => \PowerComponents\LivewirePowerGrid\Plugins\Export\OpenSpout\v5\ExportToXLS::class,
'csv' => \PowerComponents\LivewirePowerGrid\Plugins\Export\OpenSpout\v5\ExportToCsv::class,
],
],Flatpickr โ
Used by the Datetime Picker Filter and Date Picker Filter.
npm i flatpickr --saveimport flatpickr from "flatpickr";@import "flatpickr/dist/flatpickr.min.css";Locale options live under plugins.flatpickr:
'plugins' => [
'flatpickr' => [
'locales' => [
'pt_BR' => [
'locale' => 'pt',
'dateFormat' => 'd/m/Y H:i',
'enableTime' => true,
'time_24hr' => true,
],
],
],
],TomSelect โ
Optional driver for the Multi Select Filter.
npm i tom-selectimport TomSelect from "tom-select";
window.TomSelect = TomSelect'plugins' => [
'select' => [
'default' => 'tom',
'tom' => [
'cdn' => 'https://cdn.jsdelivr.net/npm/tom-select@2.4.1/dist/js/tom-select.complete.min.js',
'css' => 'https://cdn.jsdelivr.net/npm/tom-select@2.4.1/dist/css/tom-select.css',
],
],
],SlimSelect โ
Default driver for the Multi Select Filter.
npm i slim-selectimport SlimSelect from 'slim-select'
window.SlimSelect = SlimSelect'plugins' => [
'select' => [
'default' => 'slim',
'slim' => [
'cdn' => 'https://unpkg.com/slim-select@2.9.1/dist/slimselect.min.js',
'css' => 'https://unpkg.com/slim-select@2.9.1/dist/slimselect.css',
],
],
],TIP
For both select drivers, PowerGrid does not load the cdn / css URLs. Install the library and expose it on window. The active driver's array is passed to the library constructor as options.
Application Structure โ
These keys affect powergrid:create, not table runtime.
Custom Namespace โ
Components are generated under Livewire's class_namespace (not a PowerGrid config key):
'class_namespace' => 'Domain',See Create Command.
Auto-Discover Models โ
Directories scanned for Eloquent models in the create assistant:
'auto_discover_models_paths' => [
app_path('Models'),
base_path('Domain'),
],