PHPackages                             ildaviz/filament-language-tab - 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. [Admin Panels](/categories/admin)
4. /
5. ildaviz/filament-language-tab

ActiveLibrary[Admin Panels](/categories/admin)

ildaviz/filament-language-tab
=============================

A Laravel package to add a language tab to the Filament admin panel

1.0.0(2y ago)4491MITPHP

Since Feb 17Pushed 2y ago1 watchersCompare

[ Source](https://github.com/ILDaviz/filament-language-tab)[ Packagist](https://packagist.org/packages/ildaviz/filament-language-tab)[ RSS](/packages/ildaviz-filament-language-tab/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (1)Dependencies (8)Versions (2)Used By (0)

Filament Language Tab
---------------------

[](#filament-language-tab)

Administers multi-language content in tabs. Each tab is divided by language. You can go and customize the label or tab content to your liking. In addition, there is a Facade to also use this system in modals or wherever you like. An easy way to manage multi-language sites with Filament!

### Preview

[](#preview)

[![preview](https://github.com/ILDaviz/filament-language-tab/raw/main/preview.gif?raw=true)](https://github.com/ILDaviz/filament-language-tab/blob/main/preview.gif?raw=true)

### Installation

[](#installation)

```
composer require ildaviz/filament-language-tab:dev-main
```

Publish the configuration:

```
php artisan vendor:publish
select: Tag: filament-language-tab-config

```

### Set Spatie Translatable on models

[](#set-spatie-translatable-on-models)

```
namespace App\Models;

use Spatie\Translatable\HasTranslations;

class Posts extends Model
{
    ...

    use HasTranslations;

    public $translatable = [
        'title',
        'content',
        'slug',
        'images',
        ...
    ];

    ...
}
```

### Usage for resources

[](#usage-for-resources)

1. Add on config/filament-language-tab.php your languages.
2. Add this element on your create and edit page.

Add on Crate page and Edit page this "use" statement.

```
use FilamentLanguageTab\Concerns\UseTranslatablePage;

class CreatePost ...
{
    use UseTranslatablePage;

    ...
```

```
use FilamentLanguageTab\Concerns\UseTranslatablePage;

class EditPost ...
{
    use UseTranslatablePage;

    ...
```

Add these methods to change the locales or translatable attributes for a given page

```
public function setTranslatableLocales(): array
{
    return [
        'en',
        'es',
        'fr',
    ];
}

public function setTranslatableAttributes(): array
{
    return [
        'title',
        'content',
        'slug',
        'images',
    ];
}
```

3. Add on your form this component. Example:

```
use FilamentLanguageTab\Components\TabsTranslatable;
use FilamentLanguageTab\Facades\LanguageTab;

TabsTranslatable::make('translations')
    ->makeForm(
        // Use the "lang" props to have the language cycled
        // You can also use the other Filament closures.
        getLabelTab: function ($lang) {
            return 'Translations ' . $lang;
        },
        // Use the "lang" props to have the language cycled
        // You can also use the other Filament closures.
        getFormTranslatableContent: function ($lang) {
            return [
                Forms\Components\Group::make([
                    Forms\Components\TextInput::make(LanguageTab::makeName('title', $lang))
                        ->label(__(LanguageTab::makeName('title', $lang)))
                        ->placeholder(__(LanguageTab::makeName('placeholder', $lang)))
                        ->required(),
                    Forms\Components\Textarea::make(LanguageTab::makeName('content', $lang))
                        ->label(__(LanguageTab::makeName('content', $lang)))
                        ->placeholder(__(LanguageTab::makeName('content', $lang)))
                        ->required(),
                    Forms\Components\TextInput::make(LanguageTab::makeName('slug', $lang))
                        ->label(__(LanguageTab::makeName('slug', $lang)))
                        ->placeholder(__(LanguageTab::makeName('slug', $lang)))
                        ->required(),
                    Forms\Components\FileUpload::make(LanguageTab::makeName('images', $lang))
                        ->multiple()
                        ->label(__(LanguageTab::makeName('images', $lang)))
                        ->placeholder(__(LanguageTab::makeName('images', $lang)))
                        ->required(),
                ])
            ];
        }
    )
```

TabsTranslatable is a wrapper for the Tabs component. It is used to create a tab for each language and to manage the translations of the fields.

To add custom languages.

```
->languages(['en', 'es', 'fr'])
```

For create the form for each language.

```
->makeForm(
    // Use the "lang" props to have the language cycled
    // You can also use the other Filament closures.
    getLabelTab: function (string $lang) {}
    // Use the "lang" props to have the language cycled
    // You can also use the other Filament closures.
    getFormTranslatableContent: function (string $lang) {}
)
```

Add correct label for fields.

```
LanguageTab::makeName('{name of field}', $lang)

//example:
LanguageTab::makeName('title', $lang)

//result:
'title-en'
```

### Usage on modals or other components

[](#usage-on-modals-or-other-components)

```
// Use LanguageTab facade.

use FilamentLanguageTab\Facades\LanguageTab;

// Initialize the LanguageTab facade.
init()
// For change locales (optional)
setTranslatableLocales(array $locales = [])
// Set the translatable attributes from the specific model.
getTranslatableAttributes(string $modelClass)
// Set the translatable attributes. (optional)
setTranslatableAttributes(array $translatableAttributes = [])
// Use before create event
beforeCreate(string $modelClass, array $data)
// Use before fill event
beforeFill(Model $model, array $data)
// Use before save event
beforeSave(Model $model, array $data)
// Get the locales from the configuration.
array getLocales()
// Make the name of the field for the form.
string makeName(string $name, string $locale)
```

### Issue Reporting

[](#issue-reporting)

Please report any problems or bugs in the dedicated issues section on GitHub. Contributions and suggestions are welcome.

### License

[](#license)

This package is distributed under the MIT license. For more information, refer to the LICENSE file.

###  Health Score

23

—

LowBetter than 25% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity42

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

Unknown

Total

1

Last Release

911d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/11a5654365807b4060760d6f086ce8926ade94c6f59de7cfa9449145c4aa5555?d=identicon)[ILDaviz](/maintainers/ILDaviz)

---

Top Contributors

[![ILDaviz](https://avatars.githubusercontent.com/u/20944415?v=4)](https://github.com/ILDaviz "ILDaviz (1 commits)")

---

Tags

filamentfilament-pluginlanguagelaravel

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/ildaviz-filament-language-tab/health.svg)

```
[![Health](https://phpackages.com/badges/ildaviz-filament-language-tab/health.svg)](https://phpackages.com/packages/ildaviz-filament-language-tab)
```

###  Alternatives

[backstage/mails

View logged mails and events in a beautiful Filament UI.

16429.7k](/packages/backstage-mails)[finity-labs/fin-mail

A powerful email template manager and composer for Filament with dynamic token replacement, template versioning, and inline email sending.

316.8k2](/packages/finity-labs-fin-mail)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3915.5k](/packages/rawilk-profile-filament-plugin)[stephenjude/filament-two-factor-authentication

Filament Two Factor Authentication: Google 2FA + Passkey Authentication

85240.3k9](/packages/stephenjude-filament-two-factor-authentication)[statikbe/laravel-filament-flexible-content-blocks

The Laravel Filament Flexible Content Blocks package helps you to easily create content in Filament for any model, with predefined or custom blocks, and foreach block an extendable Blade view component.

17927.9k6](/packages/statikbe-laravel-filament-flexible-content-blocks)[marcelweidum/filament-passkeys

Use passkeys in your filamentphp app

6758.2k2](/packages/marcelweidum-filament-passkeys)

PHPackages © 2026

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