filament/spatie-laravel-translatable-plugin
Filament v3 plugin integrating spatie/laravel-translatable into resources: set default locales, mark models as translatable, add Translatable traits to resources and pages, and use a LocaleSwitcher action to edit content per locale. Now maintained by Lara Zeus.
spatie/laravel-translatable, enabling seamless management of multilingual models (e.g., CMS pages, product descriptions, or localized content). This aligns well with applications requiring i18n without manual JSON/XML handling.spatie/laravel-translatable + custom API routes).spatie/laravel-translatable (v3.x+) and Filament v3.x. Version conflicts unlikely if the stack is modern.modifyTranslatableFields). Extensible for edge cases (e.g., fallback locales, custom validation).locale columns.withTranslations().en if fr is missing)?spatie/laravel-translatable (v3.x) for Eloquent models.laravel-localization or mcpowermts/laravel-localization for frontend routing.spatie/laravel-translatable and configure models:
composer require spatie/laravel-translatable
php artisan vendor:publish --provider="Spatie\Translatable\TranslatableServiceProvider"
use Spatie\Translatable\HasTranslations;
class Page extends Model implements HasTranslations {
public $translatable = ['title', 'content'];
}
composer require filament/spatie-laravel-translatable-plugin
app/Providers/Filament/AdminPanelProvider.php:
public function panel(Panel $panel): Panel {
return $panel
->plugins([
\FilamentSpatieTranslatablePlugin::make(),
]);
}
use Filament\Forms\Components\TextInput;
use FilamentSpatieTranslatablePlugin\Forms\Components\TranslatableTextInput;
public static function form(Form $form): Form {
return $form->schema([
TranslatableTextInput::make('title')->required(),
TranslatableTextInput::make('content')->rows(5),
]);
}
locale column exists (handled by spatie/laravel-translatable).filament/spatie-laravel-translatable-plugin for Filament v3.x compatibility. Minor updates likely low-risk.spatie/laravel-translatable: Critical for backend logic. Major version bumps may require testing.locale and translatable_key columns.withTranslations(['en', 'fr'])).translations table with proper indexing.spatie/laravel-caching to cache translations per locale.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Plugin conflicts with Filament core | UI breaks or translatable fields disappear | Test with Filament’s latest stable version. |
| Missing translations in production | Inconsistent user experience | Implement fallback locales and alerts. |
| Database timeouts on large datasets | Slow admin panel | Optimize queries, paginate translatable fields. |
| Locale-specific validation errors | Data corruption or rejected edits | Add explicit validation per locale. |
| Plugin not updating with Filament | Feature drift | Pin versions or contribute to plugin updates. |
spatie/laravel-translatable + Filament plugin hooks.How can I help you explore Laravel packages today?