PHPackages                             maggomann/filament-model-translator - 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. maggomann/filament-model-translator

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

maggomann/filament-model-translator
===================================

The package translates the Eloquent models using a currently specified translation file. The Eloquent models are used internally in \[filament's\](https://filamentphp.com/) Resources and RelationManagers for translation. This package provides traits for the Resources and RelationManagers to translate them automatically.

v1.1.1(9mo ago)36.7k[2 issues](https://github.com/Maggomann/filament-model-translator/issues)[3 PRs](https://github.com/Maggomann/filament-model-translator/pulls)1MITPHPPHP ^8.1CI passing

Since Jan 11Pushed 4mo ago2 watchersCompare

[ Source](https://github.com/Maggomann/filament-model-translator)[ Packagist](https://packagist.org/packages/maggomann/filament-model-translator)[ Docs](https://github.com/maggomann/filament-model-translator)[ RSS](/packages/maggomann-filament-model-translator/feed)WikiDiscussions v1.x Synced 1mo ago

READMEChangelog (9)Dependencies (14)Versions (15)Used By (1)

[![GitHub Tests Action Status](https://camo.githubusercontent.com/13af0d0c2683ba166ef415928ff1dff886de71a31d74209d0183ba9ebcdcb81e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f4d6167676f6d616e6e2f66696c616d656e742d6d6f64656c2d7472616e736c61746f722f72756e2d74657374732e796d6c3f6272616e636825334176302e78266c6162656c3d7465737473)](https://github.com/Maggomann/filament-model-translator/actions?query=workflow%3Arun-tests+branch%3Av0.x) [![GitHub license](https://camo.githubusercontent.com/b66fca0c401944802861face7b08516fc3f44b79320f066862e936a3eb51726e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f4d6167676f6d616e6e2f66696c616d656e742d6d6f64656c2d7472616e736c61746f72)](https://github.com/Maggomann/filament-model-translator/blob/v0.x/LICENSE.md) [![Total Downloads](https://camo.githubusercontent.com/4bebc3c3532d6981a9c371ed03a180c2c1184ba8bc67ec574fcb4453d79ab546/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6167676f6d616e6e2f66696c616d656e742d6d6f64656c2d7472616e736c61746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/maggomann/filament-model-translator)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[](#--)

Filament model translator package for filament v3.x
===================================================

[](#filament-model-translator-package-for-filament-v3x)

This package is tailored for [Filament Admin Panel v3.x](https://filamentphp.com/docs/3.x/admin/installation).

Make sure you have installed the admin panel before you continue with the installation. You can check the [documentation here](https://filamentphp.com/docs/3.x/admin/installation)

The package translates the Eloquent models using a currently specified translation file. The Eloquent models are used internally in [filament's](https://filamentphp.com/docs/3.x/admin/installation) Resources and RelationManagers for translation. This package provides traits for the Resources and RelationManagers to translate them automatically.

Supported Versions
------------------

[](#supported-versions)

PHP VersionsLaravel Versions8.3, 8.2, 8.110.\*8.3, 8.211.\*Installation
------------

[](#installation)

You can install the package via composer:

```
composer require maggomann/filament-model-translator
```

Add the plugin to your desired Filament panel:

```
use Maggomann\FilamentModelTranslator\FilamentModelTranslatorServicePlugin;

class AdminPanelProvider extends PanelProvider
{
    public function panel(Panel $panel): Panel
    {
        return $panel
            ...
            ->plugins([
                FilamentModelTranslatorServicePlugin::make()
            ]);
    }
}
```

How is it used?
---------------

[](#how-is-it-used)

### The language files

[](#the-language-files)

The translations are currently called from the `filament-model.php` translation file, which must be located in the following directory tree:

```
lang
    de
        filament-model.php
    en
        filament-model.php
```

The `filament-model.php` file within the package serves as a structured language file for translations. It enables defining translations for various entities such as models, their attributes, and navigation elements.

```
