- How do I install happenv-com/filament-translatable in a Laravel app?
- Install it with composer require happenv-com/filament-translatable, then run php artisan filament:assets to publish the package assets. Register the plugin on your panel using Panel::plugin() and pass in the locales you want to expose. From there you can call the translatable() macro on any Filament field. The whole setup is additive, so removing the plugin later is reversible.
- Which translation backends does filament-translatable support?
- It ships with spatie/laravel-translatable as the default backend and also supports astrotomic/laravel-translatable as an alternative. Spatie users get a near zero-change adoption path. Astrotomic users must swap in the vendor-supplied AstrotomicTranslatable trait on their models, and the translation mode is selected via an enum at plugin, component, or field level. Because mode can be set in three places, keep it consistent to avoid configuration drift.
- Does filament-translatable work with Filament 3, 4, and 5?
- The package advertises support for Filament 3, 4, and 5, but not from the same install. Package v4 covers Filament 4 and 5, while Filament 3 requires the older v2 line under a different namespace. A mixed-version estate therefore needs two installs or an upgrade first. Verify the PHP and Laravel constraints in Composer before committing, and assume PHP 8.2 or newer.
- How do I make a Filament form field translatable?
- Any Filament field can adopt the translatable() macro, which renders it inside a tabbed locale interface using the Translations component. Note that the macro switches the fluent context from the field to the component, so ordering matters: call required() before translatable(), not after. Getting this backwards silently changes behaviour rather than throwing a clear error. Call out the ordering rule in code review and onboarding docs.
- Can I load available locales from the database instead of hard-coding config?
- Yes. The locale list passed when registering the plugin accepts a closure, for example fn () => Language::pluck('code', 'code')->all(). That lets you keep locale administration in the database rather than in a static config file. Just make sure the closure stays cheap, since it can be evaluated during form rendering.
- How do I require one locale while leaving the others optional?
- The package provides requiredLocale() and requiredDefaultLocale() helpers for exactly this case. They cover the two most common content-team requests: a mandatory default language and a mandatory non-default locale. Apply them on the field before calling translatable() so the required rule is attached to the right context.
- How do I customise how each translatable field is rendered per locale?
- Use decorateTranslationField() to adjust field decoration for individual locales, which is useful for labels, placeholders, or per-language hints. This is part of the component's configurable surface, and further options are available at plugin and component level. The full method surface is not published as an API reference, so read the source for anything beyond the README examples.
- Does filament-translatable work inside repeaters, builders, relation managers, and wizard steps?
- The README documents standard form usage, and there is no public evidence of behaviour inside repeaters, builders, relation managers, or multi-step wizards, where nested state paths get complicated. Treat those contexts as unproven and write explicit tests before relying on them. If you use Astrotomic, also confirm whether the component hydrates the translation relation itself or expects you to pre-load it on edit forms.
- Does filament-translatable handle table columns, infolists, and API serialization of translated values?
- No. The documentation covers forms only, so table columns, infolists, and API output of translated attributes remain your responsibility. This is a presentation-layer package; it does not own persistence and delegates storage to the underlying translation library. Plan the display side separately rather than assuming the package will cover it.
- Is filament-translatable safe for production, and what are the maintenance risks?
- Adoption signal is thin at around 11 stars and no dependents, with a single vendor behind it and README-only documentation, though passing tests, PHPStan, and Rector workflows are a genuine quality positive. There is no public corpus of production edge cases, and a new Filament major could leave you pinned, so decide on a fork-and-own plan before adoption rather than after. Also benchmark wide content forms with 8 or more locales, since performance characteristics are undocumented. If those risks are acceptable, the low-friction path is Laravel with Filament 4 or 5 and spatie/laravel-translatable already in place.