- How do I install tomshaw/electricgrid in a Laravel application?
- Install it with composer require tomshaw/electricgrid, then run php artisan electricgrid:install. Add the @electricgridStyles and @electricgridScripts Blade directives and render a table with a Livewire tag such as <livewire:tables.orders-table />. Check the README and Packagist metadata for the supported Laravel, PHP, and Livewire constraints before committing.
- Does Electric Grid support Laravel 11 and Livewire 3?
- The README excerpt does not publish a Laravel, PHP, or Livewire version matrix, so support is not proven from the documentation alone. Check the Packagist dependency constraints, CI workflow, and tagged releases, then pin the package and run the test suite against your exact framework versions. Treat Livewire lifecycle and Blade compilation compatibility as an explicit verification task.
- How do I create a data table component with Electric Grid?
- Create one Livewire subclass per table that extends TomShaw\ElectricGrid\Component and override declarative hooks such as builder(), columns(), filters(), actions(), rowClick(), and setup(). The hooks return fluent value objects such as Column::add()->sortable()->exportable() and Filter::text(), keeping table configuration in code. Render the subclass from Blade using its Livewire tag.
- Can Electric Grid use an Eloquent builder or a collection as its data source?
- Yes, builder() accepts either an Eloquent Builder or a Collection/array, so you can back grids with ORM queries or with API and config payloads. The trade-off is that Collection sources sort, filter, and paginate in PHP memory, which scales very differently from database-backed Eloquent queries. Use Eloquent for large datasets and reserve Collection sources for small or external payloads.
- Are Electric Grid sortable and filterable column identifiers safe from SQL injection?
- The provided documentation does not explicitly guarantee that sortable and filterable identifiers are whitelisted against the declared columns() and filters() definitions before reaching the query builder. This is the highest-severity item to verify because request-derived column or filter names could alter query clauses. Test malicious sort and filter payloads and inspect the package internals or patch them if validation is missing. Do not deploy until you have confirmed identifier handling.
- How should I authorize mass actions, exports, and clickable rows in Electric Grid?
- Electric Grid does not appear to enforce application authorization for mass actions, exports, or clickable row routes; the README example loops events without a visible policy check. Gate every action, export, and row-click destination with your own Laravel policies and middleware. Also verify that hidden or disabled UI controls cannot be invoked directly through Livewire requests.
- What dependencies do Electric Grid xlsx, csv, pdf, and html exports require?
- The README excerpt lists xlsx, csv, pdf, and html exports but does not name the concrete spreadsheet, PDF, or HTML dependencies, their versions, or their licenses. Inspect the package composer.json and lock file before adoption, because PDF and spreadsheet libraries add memory, font, and security-advisory surface area. Test export memory usage and output fidelity with realistic datasets in your own environment.
- Will @electricgridStyles and @electricgridScripts work with a Vite-only Laravel asset pipeline?
- The package ships CSS and JavaScript through @electricgridStyles and @electricgridScripts, but the provided context does not confirm whether those directives inject prebuilt files, CDN assets, or Vite-compatible entries. Verify the generated HTML and asset URLs in a production build, including CSP and cache-busting behavior. If your pipeline is Vite-only, plan to publish or adapt the assets rather than assume drop-in compatibility.
- Is tomshaw/electricgrid production-ready and actively maintained?
- Adoption evidence is thin: the assessment cites 11 stars and zero dependents, so there is little third-party production usage to learn from. It is a single-maintainer MIT package, mitigated by a changelog, tagged releases, and a CI badge, but a fork-and-patch budget is prudent. Check recent commit cadence, open issues, and response times before relying on it for a critical back office. Pin versions and keep your table subclasses thin to reduce upgrade risk.
- What are alternatives to Electric Grid for Laravel Livewire data tables?
- Common alternatives include Filament tables, other Livewire table packages, and building a custom Livewire table for your exact needs. Electric Grid is strongest when you want declarative table subclasses with broad built-in filters, exports, mass actions, and infinite scroll. Compare version support, authorization patterns, export dependencies, and maintenance activity before choosing.