lara-zeus/spatie-translatable
Filament v4 plugin adding Spatie Laravel Translatable support to your admin panel. Includes default locales, locale switcher, translation on create/edit/list/view pages, per-resource locale settings, and translatable relation managers.
laravel-translatable package, leveraging its core translation logic while adding Filament-specific UI/UX layers (e.g., locale switchers, CRUD page support). This modularity allows for granular adoption—teams can use only the translation logic or the full Filament integration.HasTranslations, HasActiveLocaleSwitcher) to minimize boilerplate, adhering to Laravel’s dependency injection and service container principles.setTranslatableLocales(['en', 'es'])), enabling selective adoption for specific models (e.g., only Post or Product).solution-forest/translate-field) for complex types (e.g., rich text, file uploads). This avoids forcing custom field implementations.mvenghaus/translatable-inline for advanced fields.laravel-translatable elsewhere in the app? If yes, this package will integrate cleanly. If no, evaluate the effort to adopt it.en if es is missing)? This isn’t supported out-of-the-box.RichEditor, FileUpload)? If complex, budget time for third-party plugins or custom components.filament/support and spatie/laravel-translatable.spatie/laravel-translation-manager or custom solutions.laravel-translatable.
filament/support, spatie/laravel-translatable).composer why-not to check for version conflicts.composer require spatie/laravel-translatable
php artisan vendor:publish --provider="Spatie\Translatable\TranslatableServiceProvider"
composer require lara-zeus/spatie-translatable
Publish assets/config if needed:
php artisan vendor:publish --provider="LaraZeus\SpatieTranslatable\SpatieTranslatableServiceProvider"
use Spatie\Translatable\HasTranslations;
use LaraZeus\SpatieTranslatable\Traits\HasActiveLocaleSwitcher;
class Post extends Model
{
use HasTranslations, HasActiveLocaleSwitcher;
public $translatable = ['title', 'content'];
}
config/translatable.php or per-resource:
public static function getTranslatableLocales(): array
{
return ['en', 'es', 'fr'];
}
app/Providers/Filament/AdminPanelProvider.php:
public function panel(Panel $panel): Panel
{
return $panel
->plugin(LaraZeus\SpatieTranslatable\FilamentPlugin::make());
}
HasTranslations trait to your Filament resources:
use LaraZeus\SpatieTranslatable\Traits\HasTranslations;
class PostResource extends Resource
{
use HasTranslations;
public static function form(Form $form): Form
{
return $form->schema([
// Translatable fields will auto-adapt
]);
}
}
mvenghaus/translatable-inline).filament-spatie-media-library or filament-notifications to ensure no conflicts in resource pages.Select, Checkbox) will work as-is. Translatable fields require compatible plugins or custom components.spatie/laravel-translatable provides API helpers).title, content).spatie/laravel-translatable and lara-zeus/spatie-translatable for breaking changes. Use dependabot to track updates.How can I help you explore Laravel packages today?