power-components/livewire-powergrid
Build modern, customizable data tables with Laravel Livewire in minutes. PowerGrid ships with sensible defaults plus sorting, filtering, global search, inline editing, action buttons/checkboxes, and export—minimal setup, powerful results.
Install the package via Composer: composer require power-components/livewire-powergrid. Publish the config and assets: php artisan vendor:publish --tag=powergrid-config and --tag=powergrid-public. Create a PowerGrid table class using the Artisan command: php artisan make:power-grid-table PostTable. In your Blade view, render the table with @livewire('post-table'). Start with the minimal example: define columns (addColumns), data source (DataSource), and basic formatting—no custom actions or filters needed to get started.
Use PowerGridComponent as the base class for all tables. Define data sources imperatively using Eloquent models, collections, or raw queries via datasource(). For responsive designs, enable responsive mode in config and use Tailwind classes for mobile columns toggle. leverage actions() for per-row buttons (edit, delete) or bulk actions via batchActions(). Utilize filters() for search, select, and date filters—configure them as filterSelect, filterInput, or custom filter components. For custom rendering, use detail() to show expandable rows or header() / footer() slots for totals or instructions.
Be aware of Livewire’s limitations: avoid large JSON payloads in mount()—initialize data lazily with DataSource. When customizing headers/footers, ensure proper alignment with column widths using colSpan() or Tailwind’s col-span-*. Be cautious with remember()—it can cause stale data if not handled alongside cache invalidation or reactivity. Use th() or td() closures with care: return plain strings or valid HTML, but avoid complex objects. For debugging, enable dd() in filters() or actions() closures—but remove before production. Extend functionality by publishing and modifying Blade components (pg-{component}) in resources/vendor/powergrid.
How can I help you explore Laravel packages today?