- How do I add Filament Forms to an existing Livewire component?
- Extend your Livewire component with the `Form` trait and define a `form()` method returning a schema. For example, use `TextInput::make('name')->required()` inside the schema array. The package handles validation, state, and rendering automatically.
- Can I use Filament Forms without Livewire?
- No, Filament Forms requires Livewire as it relies on its reactivity and server-driven state. If you’re not using Livewire, you’d need to adopt it first, which may involve migrating frontend logic or refactoring existing forms.
- What Laravel versions does Filament Forms support?
- Filament Forms supports Laravel 9 and later, including Laravel 10. Always check the package’s release notes for the latest compatibility updates, especially if using LTS versions.
- How do I customize form fields or validation logic?
- Override default behavior by extending components (e.g., `TextInput`) or using Filament’s theming system. For validation, leverage Laravel’s built-in rules or add custom logic via the `rules()` method on form fields.
- Will Filament Forms work with Inertia.js or Vue/React frontends?
- Filament Forms is designed for Livewire, which works with Inertia.js, but integration requires Livewire’s Inertia setup. For Vue/React, you’d need to manage form state separately, as Filament Forms relies on Livewire’s server-side reactivity.
- Are there performance concerns with complex forms?
- Large forms may introduce latency due to Livewire’s server-driven updates. Optimize by using lazy loading, debouncing validation, or splitting forms into smaller components. Test with real-world data to measure impact.
- How do I test Filament Forms in my Laravel app?
- Test forms by mocking Livewire’s state management and asserting schema validation. Use Laravel’s testing tools (e.g., `assertValid()`) and Livewire’s testing helpers like `actingAs()` for authenticated form submissions.
- Can I use Filament Forms in production without Filament Admin?
- Yes, Filament Forms works independently of Filament Admin. Install it via Composer (`filament/forms`) and use it in any Livewire component, though you’ll miss Filament’s built-in styling and admin panel integrations.
- What alternatives exist for building forms in Laravel?
- Alternatives include Nova Forms (Laravel Nova), Forge (Taylor Otwell’s package), or manual Blade forms with Form Requests. Filament Forms stands out for its Livewire integration, low-code approach, and Filament Admin compatibility.
- How do I migrate existing Blade forms to Filament Forms?
- Replace manual Blade forms by converting inputs to Filament components (e.g., `TextInput` for `<input>`). Use the `form()` method to define the schema, then replace form submission logic with Livewire’s `wire:submit`. Start with low-risk forms to validate the migration.