One command to start
powergrid:create generates a working table from a model, query or collection.
Tabs, filters, search, inline editing and export from a single PHP class. Tailwind, DaisyUI or Flux.
Install the package, generate a component, drop it in a view.
composer require power-components/livewire-powergridphp artisan powergrid:create<livewire:dish-table />Columns, tabs, filters and actions live in a single Livewire component. No JavaScript to write.
public function setUp(): array
{
return [
PowerGrid::tabs()
->add('all', label: 'All')
->add('sold_out', label: 'Sold out',
scope: ['in_stock', false]),
PowerGrid::header()->showSearchInput(),
];
}
public function columns(): array
{
return [
Column::make('Name', 'name')->searchable()->sortable(),
Column::make('Price', 'price')->sortable(),
Column::make('Stock', 'in_stock')->toggleable(),
];
}