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

ActiveLibrary[Admin Panels](/categories/admin)

ezappslab/filament-translatable
===============================

Filament Translatable adds locale-aware resource pages to FilamentPHP panels using Spatie Laravel Translatable

1.0.0(2mo ago)02MITPHPPHP ^8.2 || ^8.3 || ^8.4 || ^8.5

Since May 16Pushed 2mo agoCompare

[ Source](https://github.com/ezappslab/filament-translatable)[ Packagist](https://packagist.org/packages/ezappslab/filament-translatable)[ RSS](/packages/ezappslab-filament-translatable/feed)WikiDiscussions main Synced 3w ago

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

Filament Translatable
=====================

[](#filament-translatable)

Filament Translatable adds locale-aware resource pages for Filament panels that use [spatie/laravel-translatable](https://github.com/spatie/laravel-translatable).

The package provides:

- A Filament panel plugin for configuring available locales.
- Page concerns for create, edit, list, and view resource pages.
- A locale selector header action.
- A content driver that reads, writes, displays, and searches the active locale of Spatie translatable attributes.

Requirements
------------

[](#requirements)

- PHP 8.2 or higher
- Filament 5
- `spatie/laravel-translatable` 6.11.4 or higher

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

[](#installation)

Install the package with Composer:

```
composer require ezappslab/filament-translatable
```

Run the install command:

```
php artisan filament-translatable:install
```

The installer can publish the configuration file and register the package service provider in your application.

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

[](#configuration)

Configure the locales that should be available in your Filament panel:

```
use Infinity\FilamentTranslatable\Enums\Locale;

return [
    'locales' => [
        Locale::English,
        Locale::German,
        Locale::Spanish,
    ],

    'fallback_locale' => Locale::English,
];
```

You can also configure locales directly when registering the plugin on a panel:

```
use Filament\Panel;
use Filament\PanelProvider;
use Infinity\FilamentTranslatable\Enums\Locale;
use Infinity\FilamentTranslatable\FilamentTranslatablePlugin;

class AdminPanelProvider extends PanelProvider
{
    public function panel(Panel $panel): Panel
    {
        return $panel
            ->default()
            ->id('admin')
            ->path('admin')
            ->plugin(
                FilamentTranslatablePlugin::make()
                    ->locales([
                        Locale::English,
                        Locale::German,
                    ])
                    ->fallbackLocale(Locale::English)
            );
    }
}
```

Preparing Models
----------------

[](#preparing-models)

Use Spatie's `HasTranslations` trait on any model that has translated attributes. The translated columns should be JSON-compatible columns in your database.

```
namespace App\Models;

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

class Product extends Model
{
    use HasTranslations;

    public array $translatable = [
        'name',
        'description',
    ];

    protected $fillable = [
        'name',
        'description',
        'is_active',
    ];

    protected function casts(): array
    {
        return [
            'name' => 'array',
            'description' => 'array',
            'is_active' => 'boolean',
        ];
    }
}
```

Example migration columns:

```
$table->json('name');
$table->json('description');
$table->boolean('is_active')->default(true);
```

Using Translatable Resource Pages
---------------------------------

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

Add the matching concern to each Filament resource page and add the locale selector to the page header actions.

### List Page

[](#list-page)

```
namespace App\Filament\Resources\ProductResource\Pages;

use App\Filament\Resources\ProductResource;
use Filament\Resources\Pages\ListRecords;
use Infinity\FilamentTranslatable\Actions\SelectLocaleAction;
use Infinity\FilamentTranslatable\Resources\Pages\Concerns\HasTranslatableListRecords;

class ListProducts extends ListRecords
{
    use HasTranslatableListRecords;

    protected static string $resource = ProductResource::class;

    protected function getHeaderActions(): array
    {
        return [
            SelectLocaleAction::make(),
        ];
    }
}
```

### Create Page

[](#create-page)

```
namespace App\Filament\Resources\ProductResource\Pages;

use App\Filament\Resources\ProductResource;
use Filament\Resources\Pages\CreateRecord;
use Infinity\FilamentTranslatable\Actions\SelectLocaleAction;
use Infinity\FilamentTranslatable\Resources\Pages\Concerns\HasTranslatableCreateRecord;

class CreateProduct extends CreateRecord
{
    use HasTranslatableCreateRecord;

    protected static string $resource = ProductResource::class;

    protected function getHeaderActions(): array
    {
        return [
            SelectLocaleAction::make(),
        ];
    }
}
```

### Edit Page

[](#edit-page)

```
namespace App\Filament\Resources\ProductResource\Pages;

use App\Filament\Resources\ProductResource;
use Filament\Resources\Pages\EditRecord;
use Infinity\FilamentTranslatable\Actions\SelectLocaleAction;
use Infinity\FilamentTranslatable\Resources\Pages\Concerns\HasTranslatableEditRecord;

class EditProduct extends EditRecord
{
    use HasTranslatableEditRecord;

    protected static string $resource = ProductResource::class;

    protected function getHeaderActions(): array
    {
        return [
            SelectLocaleAction::make(),
        ];
    }
}
```

### View Page

[](#view-page)

```
namespace App\Filament\Resources\ProductResource\Pages;

use App\Filament\Resources\ProductResource;
use Filament\Resources\Pages\ViewRecord;
use Infinity\FilamentTranslatable\Actions\SelectLocaleAction;
use Infinity\FilamentTranslatable\Resources\Pages\Concerns\HasTranslatableViewRecord;

class ViewProduct extends ViewRecord
{
    use HasTranslatableViewRecord;

    protected static string $resource = ProductResource::class;

    protected function getHeaderActions(): array
    {
        return [
            SelectLocaleAction::make(),
        ];
    }
}
```

Resource Example
----------------

[](#resource-example)

Once the page concerns are installed, build your resource form and table normally. The package resolves translatable fields through the currently selected locale.

```
namespace App\Filament\Resources;

use App\Filament\Resources\ProductResource\Pages;
use App\Models\Product;
use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle;
use Filament\Resources\Resource;
use Filament\Schemas\Schema;
use Filament\Tables\Columns\IconColumn;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Table;

class ProductResource extends Resource
{
    protected static ?string $model = Product::class;

    public static function form(Schema $schema): Schema
    {
        return $schema->components([
            TextInput::make('name')
                ->required(),
            Textarea::make('description')
                ->required(),
            Toggle::make('is_active'),
        ]);
    }

    public static function table(Table $table): Table
    {
        return $table->columns([
            TextColumn::make('name')
                ->searchable(),
            TextColumn::make('description'),
            IconColumn::make('is_active')
                ->boolean(),
        ]);
    }

    public static function getPages(): array
    {
        return [
            'index' => Pages\ListProducts::route('/'),
            'create' => Pages\CreateProduct::route('/create'),
            'view' => Pages\ViewProduct::route('/{record}'),
            'edit' => Pages\EditProduct::route('/{record}/edit'),
        ];
    }
}
```

When a user selects Bulgarian, `name` and `description` are read from and written to the `bg` translation values. Non-translatable attributes, such as `is_active`, are handled as normal model attributes.

Relationship Fields
-------------------

[](#relationship-fields)

Translatable fields inside Filament relationship sections are also supported. Mark the related model attributes as translatable and use the same page concerns on the parent resource pages.

```
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle;
use Filament\Schemas\Components\Section;
use Filament\Schemas\Schema;

public static function form(Schema $schema): Schema
{
    return $schema->components([
        TextInput::make('name')
            ->required(),
        TextInput::make('email')
            ->email()
            ->required(),
        Section::make('Profile')
            ->relationship('profile')
            ->schema([
                TextInput::make('headline')
                    ->required(),
                TextInput::make('biography')
                    ->required(),
                Toggle::make('is_public'),
            ]),
    ]);
}
```

In this example, `profile.headline` and `profile.biography` can be translated per locale when the `Profile` model uses Spatie's `HasTranslations` trait.

Relation Managers
-----------------

[](#relation-managers)

Use `HasTranslatableRelationManager` on Filament relation managers that manage models with Spatie translatable attributes. Add `SelectLocaleAction` to the table header actions so users can switch the active locale.

```
namespace App\Filament\Resources\UserResource\RelationManagers;

use Filament\Actions\CreateAction;
use Filament\Actions\EditAction;
use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\TextInput;
use Filament\Resources\RelationManagers\RelationManager;
use Filament\Schemas\Schema;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Table;
use Infinity\FilamentTranslatable\Actions\SelectLocaleAction;
use Infinity\FilamentTranslatable\Resources\RelationManagers\Concerns\HasTranslatableRelationManager;

class ProductsRelationManager extends RelationManager
{
    use HasTranslatableRelationManager;

    protected static string $relationship = 'products';

    public function form(Schema $schema): Schema
    {
        return $schema->components([
            TextInput::make('name')
                ->required(),
            Textarea::make('description')
                ->required(),
        ]);
    }

    public function table(Table $table): Table
    {
        return $table
            ->columns([
                TextColumn::make('name')
                    ->searchable(),
                TextColumn::make('description'),
            ])
            ->headerActions([
                SelectLocaleAction::make(),
                CreateAction::make(),
            ])
            ->recordActions([
                EditAction::make(),
            ]);
    }
}
```

The relation manager uses its own active locale session key, scoped by panel, page, and relation manager class.

Scripts
-------

[](#scripts)

- `composer lint`: Run Pint and PHPStan.
- `composer test`: Run Pest tests.
- `composer build`: Build workbench assets.
- `composer serve`: Serve the workbench application.

Documentation
-------------

[](#documentation)

For more detailed information about the included tools, see [docs/tooling.md](docs/tooling.md).

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance86

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity51

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

69d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7d715ab01fa8a117ea600031ff66c9dde0ea4699dbe7a8ffeb92b97f839af6dd?d=identicon)[Rado Boydev](/maintainers/Rado%20Boydev)

---

Top Contributors

[![rado-boydev](https://avatars.githubusercontent.com/u/152566142?v=4)](https://github.com/rado-boydev "rado-boydev (1 commits)")

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[backstage/mails

View logged mails and events in a beautiful Filament UI.

16121.5k](/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.

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

Profile &amp; MFA starter kit for filament.

3914.8k](/packages/rawilk-profile-filament-plugin)[mradder/filament-logger

Audit logging, activity tracking, exports, alerts, and dashboards for Filament admin panels.

2318.8k](/packages/mradder-filament-logger)

PHPackages © 2026

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