PHPackages                             outerweb/filament-translatable-fields - 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. outerweb/filament-translatable-fields

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

outerweb/filament-translatable-fields
=====================================

Filament integration for spatie/laravel-translatable

v4.1.1(2mo ago)3582.9k↓13%9[2 PRs](https://github.com/outer-web/filament-translatable-fields/pulls)6MITPHPPHP ^8.4CI passing

Since Feb 26Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/outer-web/filament-translatable-fields)[ Packagist](https://packagist.org/packages/outerweb/filament-translatable-fields)[ Docs](https://github.com/outerweb/filament-translatable-fields)[ GitHub Sponsors](https://github.com/outer-web)[ RSS](/packages/outerweb-filament-translatable-fields/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (26)Versions (14)Used By (6)

[![Filament Translatable Fields](./docs/images/github-banner.png)](./docs/images/github-banner.png)

Filament Translatable Fields
============================

[](#filament-translatable-fields)

[![Latest Version on Packagist](https://camo.githubusercontent.com/858af8165e2d321b94c24167cd90d86da6d8abdc35f12e47cc79e10c9ba1720a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f757465727765622f66696c616d656e742d7472616e736c617461626c652d6669656c64732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/outerweb/filament-translatable-fields)[![GitHub Tests Action Status](https://camo.githubusercontent.com/f560a2eca2fd9806fdbb3b7ebab6f02288e28ec26f48b4c3d8015e99c3f4709c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6f757465727765622f66696c616d656e742d7472616e736c617461626c652d6669656c64732f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/outer-web/filament-translatable-fields/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/32124d4bd2f00f06324f06bdd769796c68f6a3a77236af67bad059e569453ca7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6f757465727765622f66696c616d656e742d7472616e736c617461626c652d6669656c64732f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/outer-web/filament-translatable-fields/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/d247e389f526f31b727fdfd4e5c16f16f6eb0f5cee19f102382b6e761402f0a2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f757465727765622f66696c616d656e742d7472616e736c617461626c652d6669656c64732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/outerweb/filament-translatable-fields)

This Filament plugin provides an integration for the [spatie/laravel-translatable](https://github.com/spatie/laravel-translatable) package.

It can easily be combined with the [lara-zeus/translatable](https://github.com/lara-zeus/translatable) package as our package only provides the Form integration. To do so, simply remove all lara-zeus specific code from the Create and Edit pages of your Filament Resources.

Instead of rendering a dropdown to select the locale, it wraps the translatable fields in a Tabs component for a better user experience.

> ⚠️ **Caution:** V4 is a complete rewrite of the package and logic. Please take a look at the installation instructions below!

Table of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
- [Changelog](#changelog)
- [License](#license)

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

[](#installation)

You can install the package via composer:

```
composer require outerweb/filament-translatable-fields
```

Add the plugin to your panel:

```
use Outerweb\FilamentTranslatableFields\TranslatableFieldsPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugins([
            // ...
            TranslatableFieldsPlugin::make(),
        ]);
}
```

Configuration
-------------

[](#configuration)

### Supported locales

[](#supported-locales)

By default, the package will try to read out the supported locales from the `config/app.php` file. It will check for `app.supported_locales` first and then fallback to `app.locales` and `app.fallback_locale`.

You can manually configure the supported locales like this:

```
use Outerweb\FilamentTranslatableFields\TranslatableFieldsPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugins([
            // ...
            TranslatableFieldsPlugin::make()
                ->supportedLocales(['en', 'de', 'fr']),
        ]);
}
```

If you want to provide custom labels for the locales, you can do it like this:

```
use Outerweb\FilamentTranslatableFields\TranslatableFieldsPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugins([
            // ...
            TranslatableFieldsPlugin::make()
                ->supportedLocales([
                    'en' => 'English',
                    'de' => 'Deutsch',
                    'fr' => 'Français',
                ]),
        ]);
}
```

If you want to dynamically provide the supported locales, you can also pass a Closure to the `supportedLocales()` method:

```
use Outerweb\FilamentTranslatableFields\TranslatableFieldsPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugins([
            // ...
            TranslatableFieldsPlugin::make()
                ->supportedLocales(fn () => getSupportedLocales()),
        ]);
}
```

### Default locale

[](#default-locale)

By default, the active tab will be the one of the app's locale when rendering the form. You can change this behavior by setting a default locale:

```
use Outerweb\FilamentTranslatableFields\TranslatableFieldsPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugins([
            // ...
            TranslatableFieldsPlugin::make()
                ->defaultLocale('de'),
        ]);
}
```

If you want to dynamically provide the default locale, you can also pass a Closure to the `defaultLocale()` method:

```
use Outerweb\FilamentTranslatableFields\TranslatableFieldsPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugins([
            // ...
            TranslatableFieldsPlugin::make()
                ->defaultLocale(fn () => auth()->user()->preferred_locale),
        ]);
}
```

Usage
-----

[](#usage)

### Marking single fields as translatable

[](#marking-single-fields-as-translatable)

To mark a single field as translatable, you can use the `translatable()` method on any Filament form field:

```
use Filament\Forms\Components\TextInput;

TextInput::make('name')
    ->translatable(),
```

This will wrap the field in a Tabs component with a tab for each supported locale.

> **Note:** Make sure to place the `translatable()` method at the end of the field definition to avoid any unexpected behavior.

#### Modifying/Validating a field for a specific locale

[](#modifyingvalidating-a-field-for-a-specific-locale)

All modifiers and validation rules applied before calling the `translatable()` method will be applied field for each locale. If you want to apply a modifier or validation rule for a specific locale only, you can use the `modifyLocalizedFieldUsing` parameter in the `translatable()` method:

```
use Filament\Forms\Components\TextInput;

TextInput::make('name')
    ->translatable(
        modifyLocalizedFieldUsing: function (TextInput $field, string $locale): TextInput {
            return match ($locale) {
                'en' => $field->required(),
                default => $field,
            };
        },
    ),
```

#### Conditionally marking a field as translatable

[](#conditionally-marking-a-field-as-translatable)

You can also conditionally mark a field as translatable by passing a bool or Closure to the `translatable()` method:

```
use Filament\Forms\Components\TextInput;

// Using a bool
TextInput::make('name')
    ->translatable(false),

// Using a Closure
TextInput::make('name')
    ->translatable(fn () => someCondition()),
```

#### Overriding the supported locales for a single field

[](#overriding-the-supported-locales-for-a-single-field)

You can override the supported locales for a single field by passing an array or Closure to the `translatable()` method:

```
use Filament\Forms\Components\TextInput;

// Using an array
TextInput::make('name')
    ->translatable(
        supportedLocales: ['en', 'de']
    ),

// Using a Closure
TextInput::make('name')
    ->translatable(
        supportedLocales: fn () => getSupportedLocales(),
    ),
```

#### Overriding the default locale for a single field

[](#overriding-the-default-locale-for-a-single-field)

You can override the default locale for a single field by passing a string or Closure to the `translatable()` method:

```
use Filament\Forms\Components\TextInput;

// Using a string
TextInput::make('name')
    ->translatable(
        defaultLocale: 'de'
    ),

// Using a Closure
TextInput::make('name')
    ->translatable(
        defaultLocale: fn () => auth()->user()->preferred_locale,
    ),
```

### Marking a group of fields as translatable

[](#marking-a-group-of-fields-as-translatable)

You can also mark a [Layout](https://filamentphp.com/docs/4.x/schemas/layouts) component as translatable. This will make all fields inside the layout translatable:

```
use Filament\Schemas\Components\Section;

Section::make()
    ->schema([
        TextInput::make('name'),
        TextInput::make('description'),
    ])
    ->translatable(),
```

This will wrap all fields inside the layout in a Tabs component with a tab for each supported locale.

> **Note:** Make sure to place the `translatable()` method at the end of the component definition to avoid any unexpected behavior.

All the options described for single fields (modifying/validating a field for a specific locale, conditionally marking as translatable, overriding supported/default locales) are also available when marking a layout component as translatable.

For modifying/validating fields inside a layout component, the provided Closure will be called for each field inside the layout.

Example:

```
use Illuminate\Support\Str;
use Filament\Forms\Components\TextInput;
use Filament\Schemas\Components\Component;
use Filament\Schemas\Components\Section;

Section::make()
    ->schema([
        TextInput::make('name'),
        TextInput::make('description'),
    ])
    ->translatable(
        modifyLocalizedFieldUsing: function (Component $field, string $locale): Component {
            if ($field instanceof TextInput && Str::startsWith($field->getName(), 'name.')) {
                return match ($locale) {
                    'en' => $field->required(),
                    default => $field,
                };
            }

            return $field;
        },
    ),
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

59

—

FairBetter than 99% of packages

Maintenance89

Actively maintained with recent releases

Popularity44

Moderate usage in the ecosystem

Community24

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 72.4% 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 ~68 days

Recently: every ~52 days

Total

12

Last Release

62d ago

Major Versions

v1.1.0 → v2.0.02024-05-20

v2.1.0 → v3.0.02025-08-20

v3.0.0 → v4.0.02025-12-10

PHP version history (3 changes)v1.0.0PHP ^8.0

v3.0.0PHP ^8.1

v4.0.0PHP ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/d5a072b1191f02ac21a84af067a579b6f3323da7e45197369a7540f98c152407?d=identicon)[outerweb.be](/maintainers/outerweb.be)

---

Top Contributors

[![SimonBroekaert](https://avatars.githubusercontent.com/u/35606498?v=4)](https://github.com/SimonBroekaert "SimonBroekaert (21 commits)")[![ahmadnajmdev](https://avatars.githubusercontent.com/u/86409804?v=4)](https://github.com/ahmadnajmdev "ahmadnajmdev (3 commits)")[![FinnPaes](https://avatars.githubusercontent.com/u/71390226?v=4)](https://github.com/FinnPaes "FinnPaes (2 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")[![vedatyilmaz](https://avatars.githubusercontent.com/u/4198651?v=4)](https://github.com/vedatyilmaz "vedatyilmaz (1 commits)")

---

Tags

laravelOuterwebfilament-translatable-fields

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/outerweb-filament-translatable-fields/health.svg)

```
[![Health](https://phpackages.com/badges/outerweb-filament-translatable-fields/health.svg)](https://phpackages.com/packages/outerweb-filament-translatable-fields)
```

###  Alternatives

[bezhansalleh/filament-language-switch

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

3431.0M16](/packages/bezhansalleh-filament-language-switch)[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)[outerweb/filament-settings

Filament integration for the outerweb/settings package

3690.9k4](/packages/outerweb-filament-settings)[outerweb/filament-image-library

Filament integration for the outerweb/image-library package

2411.5k](/packages/outerweb-filament-image-library)[outerweb/image-library

Store and link files to your models

1113.0k2](/packages/outerweb-image-library)[34ml/filament-translatable-field

A laravel filament field that handle translation

182.7k](/packages/34ml-filament-translatable-field)

PHPackages © 2026

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