- How do I install and set up Laravel Livewire Tables in a Laravel 11 project?
- Run `composer require alp-develop/laravel-livewire-tables`, then publish the config with `php artisan vendor:publish --tag=livewire-tables-config`. Configure your theme (Tailwind/Bootstrap) in `config/livewire-tables.php`, and add `[x-cloak] { display: none !important; }` to your Tailwind CSS if needed. Finally, generate a table with `php artisan make:livewiretable TableName Model`.
- Does this package support Laravel 13 and Livewire 4?
- Yes, the package is fully compatible with Laravel 10–13 and Livewire 3–4. However, upgrading to Livewire 5+ may introduce breaking changes, so pin your Livewire version in `composer.json` to avoid unexpected issues.
- What security features does Laravel Livewire Tables include for production?
- The package includes critical security hardening in v1.2.2+, such as IDOR protection, XSS sanitization, CSV injection prevention, and bulk action TOCTOU fixes. It also uses #[Locked] attributes to prevent client-side state tampering, making it suitable for sensitive data like financial or healthcare applications.
- How does performance compare for large datasets with filtering and sorting?
- The package optimizes performance with caching for filters, sorts, and columns, reducing overhead by 30%+. Use `setEagerLoad()` to avoid N+1 queries for Eloquent relations, but monitor memory usage with Laravel Debugbar, especially in high-concurrency environments.
- Can I customize the table styling beyond Tailwind or Bootstrap themes?
- While the package supports Tailwind, Bootstrap 4/5, and dark mode out of the box, deep customization (e.g., integrating AG Grid) requires manual overrides. The `livewire-tables.php` config centralizes theme settings, but per-table styling may require subclassing the `Engine` class or CSS injection.
- What frontend frameworks or libraries work best with this package?
- This package is tightly integrated with Livewire and works seamlessly with Tailwind CSS or Bootstrap 4/5. For non-Livewire stacks like Inertia.js or server-side rendering, you’ll need custom workarounds, as the package is monolithic for Livewire-only applications.
- How do I handle bulk actions securely in production?
- Bulk actions include TOCTOU protection to silently drop unauthorized IDs, but you should log dropped IDs for auditing. The package also sanitizes inputs to prevent formula injection in exports (e.g., Excel macros), ensuring secure CSV/Excel generation.
- Are there any known issues with Livewire 5 compatibility?
- Yes, upgrading to Livewire 5+ may break functionality due to changes like #[Locked] attributes and protected `getEngine()`. Pin your Livewire version to 3 or 4 in `composer.json` to avoid compatibility risks, and test thoroughly before upgrading.
- How can I test this package in my Laravel application before production?
- Start by piloting non-critical tables to validate performance and security. The package includes a new test suite (22+ files), but real-world testing is recommended. Use `setEagerLoad()` to optimize queries and monitor memory usage with `memory_get_usage()` under load.
- What alternatives exist for Livewire data tables in Laravel?
- Alternatives include custom Livewire components with Alpine.js or server-side rendering frameworks like Inertia.js. For more advanced grids, consider AG Grid or Tabulator, though these require manual integration. This package stands out for its zero-JS approach and built-in security features.