- Can I use filament/actions in a Laravel project that doesn’t use Livewire?
- No, this package is **Livewire-specific** and won’t work without it. If your project relies on plain Blade, Inertia.js, or Alpine.js, you’d need to build custom modal logic or explore alternatives like Alpine.js modals or Laravel Nova actions.
- How do I install filament/actions in a Laravel/Livewire project?
- Run `composer require filament/actions`, then import the modal component in your Livewire blade file with `@use('filament-actions::modal')` and use it via `<x-filament-actions::modal>`. No additional Laravel service provider or config is required beyond Livewire.
- Does filament/actions work with Laravel 10+ and Livewire 3?
- Yes, the package is compatible with **Laravel 9+** and **Livewire 3+**. It leverages Livewire’s modern features like `$dispatch` and reactive properties, so no version conflicts are expected if you’re using those versions or newer.
- Can I customize the modal styling to match my Tailwind/Bootstrap theme?
- Absolutely. The package supports **Tailwind CSS** and **Bootstrap** out of the box via Livewire’s class binding. Override default styles by passing classes to the modal component or extending Filament’s design system if you’re using Filament PHP.
- What’s the performance impact of using filament/actions vs. custom modals?
- filament/actions adds minimal overhead since it reuses Livewire’s existing event system (`$dispatch`, `$listen`). For most use cases, the performance difference compared to custom modals is negligible, but avoid overusing it in highly dynamic tables where modal spawning is frequent.
- How do I handle form validation inside filament/actions modals?
- Use Livewire’s built-in validation rules directly in your modal’s action class. For example, define `$rules` in the action’s Livewire component, and errors will auto-populate in the modal. You can also use Filament’s validation helpers if you’re using Filament PHP.
- Is there a way to reuse actions across multiple Livewire components?
- Yes, create a **shared Livewire action class** and reference it in multiple components. The package supports dependency injection, so you can pass data or services to the action dynamically. This is ideal for bulk actions like ‘Export’ or ‘Delete’ used across resources.
- What happens if I update Filament or Livewire—will filament/actions break?
- Since the package is tightly coupled with Livewire, **major Livewire updates (e.g., v3 → v4) could introduce breaking changes**. Monitor Filament’s changelog and test thoroughly after updates. If Filament’s Livewire integration changes, you may need to adjust your action classes.
- Are there alternatives to filament/actions for Livewire modals?
- Yes. For lightweight needs, use **Livewire’s native `$dispatch` + Alpine.js modals**. For Filament users, consider **Filament’s built-in actions** (if using Filament PHP). For non-Filament projects, libraries like **Laravel Nova actions** or **custom Livewire components** with Alpine.js are viable alternatives.
- How do I test filament/actions modals in PHPUnit?
- Test actions like any Livewire component: use `Livewire::test()` to simulate clicks, then assert modal visibility or form submissions. For example: `Livewire::test('YourComponent')->call('openActionModal')->assertSee('Modal Title');`. Mock dependencies if needed for isolated testing.