PHPackages                             hydrat/filament-lexi-translatable - 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. hydrat/filament-lexi-translatable

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

hydrat/filament-lexi-translatable
=================================

Filament support for `omaralalwi/lexi-translate`.

v0.1.0(11mo ago)0821MITPHPPHP ^8.1

Since May 19Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/Hydrat-Agency/Filament-Lexi-translatable)[ Packagist](https://packagist.org/packages/hydrat/filament-lexi-translatable)[ Docs](https://github.com/Hydrat-Agency/Filament-Lexi-translatable)[ RSS](/packages/hydrat-filament-lexi-translatable/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (2)Used By (1)

Filament Lexi Translate Plugin
==============================

[](#filament-lexi-translate-plugin)

Translate your Filament resources using [Lexi Translate](https://github.com/omaralalwi/lexi-translate) package. Adaptation of the [Filament Spatie Translatable](https://filamentphp.com/plugins/filament-spatie-translatable) plugin.

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

[](#installation)

Install the plugin with Composer:

```
composer require composer require hydrat/filament-lexi-translatable
```

Adding the plugin to a panel
----------------------------

[](#adding-the-plugin-to-a-panel)

To add a plugin to a panel, you must include it in the configuration file using the `plugin()` method:

```
use Hydrat\FilamentLexiTranslate\LexiTranslatablePlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugin(LexiTranslatablePlugin::make());
}
```

Setting the default translatable locales
----------------------------------------

[](#setting-the-default-translatable-locales)

To set up the locales that can be used to translate content, you can use the [Lexi translate](https://github.com/omaralalwi/lexi-translate) configuration file, or you can pass an array of locales to the `defaultLocales()` plugin method:

```
use Hydrat\FilamentLexiTranslate\LexiTranslatablePlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugin(
            LexiTranslatablePlugin::make()
                ->defaultLocales(['en', 'es']),
        );
}
```

Preparing your model class
--------------------------

[](#preparing-your-model-class)

You need to make your model translatable. You can read how to do this in [Lexi's documentation](https://github.com/omaralalwi/lexi-translate?tab=readme-ov-file#defining-lexitranslatable-models).

Preparing your resource class
-----------------------------

[](#preparing-your-resource-class)

You must apply the `Hydrat\FilamentLexiTranslate\Resources\Concerns\Translatable` trait to your resource class:

```
use Hydrat\FilamentLexiTranslate\Resources\Concerns\Translatable;
use Filament\Resources\Resource;

class BlogPostResource extends Resource
{
    use Translatable;

    // ...
}
```

Making resource pages translatable
----------------------------------

[](#making-resource-pages-translatable)

After [preparing your resource class](#preparing-your-resource-class), you must make each of your resource's pages translatable too. You can find your resource's pages in the `Pages` directory of each resource folder. To prepare a page, you must apply the corresponding `Translatable` trait to it, and install a `LocaleSwitcher` header action:

```
use Hydrat\FilamentLexiTranslate\Actions;
use Hydrat\FilamentLexiTranslate\Resources\Pages\ListRecords;

class ListBlogPosts extends ListRecords
{
    use ListRecords\Concerns\Translatable;

    protected function getHeaderActions(): array
    {
        return [
            Actions\LocaleSwitcher::make(),
            // ...
        ];
    }

    // ...
}
```

```
use Hydrat\FilamentLexiTranslate\Actions;
use Hydrat\FilamentLexiTranslate\Resources\Pages\CreateRecord;

class CreateBlogPost extends CreateRecord
{
    use CreateRecord\Concerns\Translatable;

    protected function getHeaderActions(): array
    {
        return [
            Actions\LocaleSwitcher::make(),
            // ...
        ];
    }

    // ...
}
```

```
use Hydrat\FilamentLexiTranslate\Actions;
use Hydrat\FilamentLexiTranslate\Resources\Pages\EditRecord;

class EditBlogPost extends EditRecord
{
    use EditRecord\Concerns\Translatable;

    protected function getHeaderActions(): array
    {
        return [
            Actions\LocaleSwitcher::make(),
            // ...
        ];
    }

    // ...
}
```

And if you have a `ViewRecord` page for your resource:

```
use Hydrat\FilamentLexiTranslate\Actions;
use Hydrat\FilamentLexiTranslate\Resources\Pages\ViewRecord;

class ViewBlogPost extends ViewRecord
{
    use ViewRecord\Concerns\Translatable;

    protected function getHeaderActions(): array
    {
        return [
            Actions\LocaleSwitcher::make(),
            // ...
        ];
    }

    // ...
}
```

If you're using a simple resource, you can make the `ManageRecords` page translatable instead:

```
use Hydrat\FilamentLexiTranslate\Actions;
use Hydrat\FilamentLexiTranslate\Resources\Pages\ManageRecords;

class ManageBlogPosts extends ListRecords
{
    use ManageRecords\Concerns\Translatable;

    protected function getHeaderActions(): array
    {
        return [
            Actions\LocaleSwitcher::make(),
            // ...
        ];
    }

    // ...
}
```

### Setting the translatable locales for a particular resource

[](#setting-the-translatable-locales-for-a-particular-resource)

By default, the translatable locales can be [set globally for all resources in the plugin configuration](#setting-the-default-translatable-locales). Alternatively, you can customize the translatable locales for a particular resource by overriding the `getTranslatableLocales()` method in your resource class:

```
use Hydrat\FilamentLexiTranslate\Resources\Concerns\Translatable;
use Filament\Resources\Resource;

class BlogPostResource extends Resource
{
    use Translatable;

    // ...

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

Translating relation managers
-----------------------------

[](#translating-relation-managers)

First, you must apply the `Hydrat\FilamentLexiTranslate\Resources\RelationManagers\Concerns\Translatable` trait to the relation manager class:

```
use Hydrat\FilamentLexiTranslate\Resources\RelationManagers\Concerns\Translatable;
use Filament\Resources\RelationManagers\RelationManager;

class BlogPostsRelationManager extends RelationManager
{
    use Translatable;

    // ...
}
```

Now, you can add a new `LocaleSwitcher` action to the header of the relation manager's `table()`:

```
use Filament\Tables;
use Filament\Tables\Table;

public function table(Table $table): Table
{
    return $table
        ->columns([
            // ...
        ])
        ->headerActions([
            // ...
            Tables\Actions\LocaleSwitcher::make(),
        ]);
}
```

### Inheriting the relation manager's active locale from the resource page

[](#inheriting-the-relation-managers-active-locale-from-the-resource-page)

If you wish to reactively inherit the locale of the `Translatable` resource page that the relation manager is being displayed on, you can override the `$activeLocale` property and add Livewire's `Reactive` attribute to it:

```
use Filament\Resources\RelationManagers\Concerns\Translatable;
use Filament\Resources\RelationManagers\RelationManager;
use Livewire\Attributes\Reactive;

class BlogPostsRelationManager extends RelationManager
{
    use Translatable;

    #[Reactive]
    public ?string $activeLocale = null;

    // ...
}
```

If you do this, you no longer need a `LocaleSwitcher` action in the `table()`.

### Setting the translatable locales for a particular relation manager

[](#setting-the-translatable-locales-for-a-particular-relation-manager)

By default, the translatable locales can be [set globally for all relation managers in the plugin configuration](#setting-the-default-translatable-locales). Alternatively, you can customize the translatable locales for a particular relation manager by overriding the `getTranslatableLocales()` method in your relation manager class:

```
use Filament\Resources\RelationManagers\Concerns\Translatable;
use Filament\Resources\RelationManagers\RelationManager;

class BlogPostsRelationManager extends RelationManager
{
    use Translatable;

    // ...

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

Publishing translations
-----------------------

[](#publishing-translations)

If you wish to translate the package, you may publish the language files using:

```
php artisan vendor:publish --tag=filament-lexi-translatable-plugin-translations
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance50

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 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

358d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d7c605c71ebef94596a6c0f89e40a62e0d685b052288fe8a0017a0378c85823f?d=identicon)[tgeorgel](/maintainers/tgeorgel)

---

Top Contributors

[![tgeorgel](https://avatars.githubusercontent.com/u/11785727?v=4)](https://github.com/tgeorgel "tgeorgel (15 commits)")

### Embed Badge

![Health badge](/badges/hydrat-filament-lexi-translatable/health.svg)

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

###  Alternatives

[barryvdh/laravel-translation-manager

Manage Laravel Translations

1.7k3.6M17](/packages/barryvdh-laravel-translation-manager)[vluzrmos/language-detector

Detect the language for your application using browser preferences, subdomains or route prefixes.

109554.8k3](/packages/vluzrmos-language-detector)[kerigard/laravel-lang-ru

Ru lang for Laravel

2116.8k](/packages/kerigard-laravel-lang-ru)[highsolutions/laravel-translation-manager

Manage Laravel Translations

1518.8k](/packages/highsolutions-laravel-translation-manager)[amendozaaguiar/laraveles-spanish-for-jetstream

Archivos de traducción al español latinoamericano para Laravel con Jetstream (auth, pagination, passwords, validation + todas las cadenas de Jetstream).

1412.1k](/packages/amendozaaguiar-laraveles-spanish-for-jetstream)

PHPackages © 2026

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