PHPackages                             jeromesiau/filament-multilang - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Localization &amp; i18n](/categories/localization)
4. /
5. jeromesiau/filament-multilang

ActiveLibrary[Localization &amp; i18n](/categories/localization)

jeromesiau/filament-multilang
=============================

Multi-language input component for Filament 3

v1.0.2(1y ago)0287↓50%MITPHPPHP ^8.1

Since Mar 30Pushed 1y ago1 watchersCompare

[ Source](https://github.com/JeromeSiau/filament-multilang)[ Packagist](https://packagist.org/packages/jeromesiau/filament-multilang)[ RSS](/packages/jeromesiau-filament-multilang/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (4)Used By (0)

Filament MultiLang Input
========================

[](#filament-multilang-input)

A component for managing multilingual fields in Filament 3, integrated with Spatie Laravel Translatable.

[![MultiLang Input Screenshot](resources/images/screenshot.png)](resources/images/screenshot.png)

Why This Plugin?
----------------

[](#why-this-plugin)

This plugin was created to offer a focused, input-level approach to multilingual content in Filament forms, unlike other solutions that implement translations at the page or fieldset level.

Key features:

- **Input-level language tabs**: Each translatable field has its own compact set of language tabs directly on the input
- **Flexible validation**: Define which languages are required on a per-field basis
- **Multiple input types**: Works seamlessly with both standard text inputs and rich text editors

The goal is to provide a streamlined editing experience for multilingual content that feels natural and integrated with Filament's design philosophy.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require jeromesiau/filament-multilang
```

This package automatically integrates [Spatie Laravel Translatable](https://github.com/spatie/laravel-translatable) to efficiently manage translations storage.

To configure available languages, you can publish the configuration file:

```
php artisan vendor:publish --tag="filament-multilang-config"
```

The published configuration file will look like this:

```
return [
    'locales' => [
        'fr' => ['name' => 'French'],
        'en' => ['name' => 'English'],
    ],
];
```

Simply modify the `locales` array to add, remove, or change the available languages for your application. Each language requires a key (language code) and a name that will be displayed in the language tabs.

By default, when displaying values in Filament tables, the component will use the translation that corresponds to your application's current locale (`APP_LOCALE` environment variable by defaut). This ensures a consistent display in listings while still maintaining full multilingual capabilities in forms.

Model Configuration
-------------------

[](#model-configuration)

To use the component with your models, make sure they use Spatie's `HasTranslations` trait:

```
use Spatie\Translatable\HasTranslations;
use Illuminate\Database\Eloquent\Model;

class Page extends Model
{
    use HasTranslations;

    public $translatable = ['title', 'content'];
}
```

Important: Spatie Translatable recommends that translatable database fields should be defined as `json` type (or `text` if JSON is not available in your database). Make sure your migration reflects this:

```
Schema::create('pages', function (Blueprint $table) {
    $table->id();
    $table->json('title');
    $table->json('content');
    $table->timestamps();
});
```

Usage
-----

[](#usage)

```
use JeromeSiau\FilamentMultilang\Components\MultiLangInput;

// In your Filament form
MultiLangInput::make('title')
    ->required() // All languages will be required

// For rich text fields
MultiLangInput::make('content')
    ->type('rich')
    ->required()

// To make only specific languages required
MultiLangInput::make('title')
    ->required()
    ->requiredLocales(['fr'])

// Customize available languages
MultiLangInput::make('title')
    ->locales([
        'fr' => ['name' => 'French'],
        'en' => ['name' => 'English'],
        'es' => ['name' => 'Spanish'],
    ])

// Customize rich editor toolbar buttons
MultiLangInput::make('content')
    ->type('rich')
    ->toolbarButtons([
        'bold',
        'italic',
        'link',
    ])

// Set editor height
MultiLangInput::make('content')
    ->type('rich')
    ->editorHeight('300px')
```

Data Transformation
-------------------

[](#data-transformation)

You can transform data before it's stored:

```
MultiLangInput::make('content')
    ->type('rich')
    ->transform(
        function ($value) {
            // Transform value before storing
            return clean($value);
        },
        function ($value) {
            // Transform value when retrieved
            return $value;
        }
    )
```

Data Structure
--------------

[](#data-structure)

Data is stored as an associative array with language codes as keys:

```
[
    'fr' => 'French content',
    'en' => 'English content',
]
```

With Spatie Laravel Translatable, this array is automatically stored in a JSON field in your database, which greatly simplifies translation management.

Styling
-------

[](#styling)

The component comes with default styling that places language tabs neatly at the top-right of each input field. You can customize the appearance by targeting the `.fi-multilang-input` CSS class in your own stylesheets.

Credits
-------

[](#credits)

- [Jérôme Siau](https://github.com/jeromesiau)
- [All Contributors](../../contributors)

License
-------

[](#license)

MIT

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance46

Moderate activity, may be stable

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

3

Last Release

412d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5654844?v=4)[Jérôme](/maintainers/JeromeSiau)[@JeromeSiau](https://github.com/JeromeSiau)

---

Top Contributors

[![JeromeSiau](https://avatars.githubusercontent.com/u/5654844?v=4)](https://github.com/JeromeSiau "JeromeSiau (2 commits)")

### Embed Badge

![Health badge](/badges/jeromesiau-filament-multilang/health.svg)

```
[![Health](https://phpackages.com/badges/jeromesiau-filament-multilang/health.svg)](https://phpackages.com/packages/jeromesiau-filament-multilang)
```

###  Alternatives

[bezhansalleh/filament-language-switch

Zero config Language Switch(Changer/Localizer) plugin for filamentphp admin

3431.0M16](/packages/bezhansalleh-filament-language-switch)[spatie/nova-translatable

Making Nova fields translatable

2231.5M1](/packages/spatie-nova-translatable)[outerweb/filament-translatable-fields

Filament integration for spatie/laravel-translatable

3582.9k8](/packages/outerweb-filament-translatable-fields)[optimistdigital/nova-translatable

A laravel-translatable extension for Laravel Nova.

202427.4k5](/packages/optimistdigital-nova-translatable)[outl1ne/nova-translatable

A laravel-translatable extension for Laravel Nova.

203416.9k8](/packages/outl1ne-nova-translatable)[statikbe/laravel-filament-chained-translation-manager

A translation manager tool for Laravel Filament, that makes use of the Laravel Chained Translator.

92108.7k](/packages/statikbe-laravel-filament-chained-translation-manager)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
