PHPackages                             trinityrank/multilanguage - 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. trinityrank/multilanguage

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

trinityrank/multilanguage
=========================

Add alternate multilanguage tags for same pages but on other language

v1.0.0(3y ago)0216MITPHPPHP ^7.4|^8.0

Since Jan 11Pushed 3y ago2 watchersCompare

[ Source](https://github.com/trinity-rank/multilanguage)[ Packagist](https://packagist.org/packages/trinityrank/multilanguage)[ Docs](https://github.com/trinity-rank/multilanguage)[ RSS](/packages/trinityrank-multilanguage/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)DependenciesVersions (22)Used By (0)

Very short description of the package
=====================================

[](#very-short-description-of-the-package)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5fac5194dc12bbbe2f931fab1db2e6bd2e6af726fed98324dd354da260801d44/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7472696e69747972616e6b2f6d756c74696c616e67756167652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/trinityrank/multilanguage)[![Total Downloads](https://camo.githubusercontent.com/c8ae1ce0394269aeaf44a859b0babb7afd4b5b1463e8f7d8be6fab4a29be6f31/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7472696e69747972616e6b2f6d756c74696c616e67756167652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/trinityrank/multilanguage)

Add alternate multilanguage tags for same pages but on other language.

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

[](#installation)

### Step 1: Install package

[](#step-1-install-package)

To get started with Laravel Multilanguage, use Composer command to add the package to your composer.json project's dependencies:

For Frontend and backend

```
    composer require trinityrank/multilanguage
```

Only for backend we need this package too

```
    composer require epartment/nova-dependency-container
```

Laravel Nova admin - Backend part
---------------------------------

[](#laravel-nova-admin---backend-part)

### Step 2: Database

[](#step-2-database)

- You need to publish migration from package

```
    php artisan vendor:publish --provider="Trinityrank\Multilanguage\MultilanguageServiceProvider" --tag="multilanguage-migration"
```

- And then you need to run migration for alltenant(s)

```
    php artisan tenant:artisan "migrate"
```

- Or only for one speciffic tenant

```
    php artisan tenant:artisan "migrate" --tenant=[--TENANT-ID--]
```

### Step 3: Update database with default language

[](#step-3-update-database-with-default-language)

- Update database field "multilang\_language" to default language for your website

```
    UPDATE `articles` SET `multilang_language`='us' WHERE 1;
    UPDATE `pages` SET `multilang_language`='us' WHERE 1;
    UPDATE `categories` SET `multilang_language`='us' WHERE 1;
    UPDATE `static_pages` SET `multilang_language`='us' WHERE 1;
```

### Step 4: Add field

[](#step-4-add-field)

- Add field to your (Operater) resource into "fields" method

```
    use Trinityrank\Multilanguage\MultilanguagePanel;

    ...

    MultilanguagePanel::make()
```

- Or if you use conditional fields than just add this into "fields" method

```
    // use "$this" or "self::", depends of resource structure
    $this->getMultilanguagePanel('Multilanguage', 'multilanguage')
```

- Fields where category depends on language select

```
    // use "$this" or "self::", depends of resource structure
    // $this->getMultilanguageCategory("Language", [Resource::class, Model::class, ['rules']]),
    // example:
    $this->getMultilanguageCategory("Language", [ReviewPageCategory::class, TypesReviewPageCategory::class, ['required']]),
```

### Step 5: If you are using conditional fields

[](#step-5-if-you-are-using-conditional-fields)

Add this in tenant-default config

```
    'conditional_fields' => [
        ...

        '{{your_page_type_name}}' => [
            'categories' => [
                'visible' => true,
                'rules' => ['required', 'min:1', 'max:1', ... ]
            ],
        ]

        ...
    ]
```

Add this in tenant-{{tenant name}} config

```
    'conditional_fields' => [
        ...

        '{{your_page_type_name}}' => [
            'language' => [
                'visible' => true
            ],
            'categories' => [
                'visible' => true,
                'visibility' => ['onlyOnIndex'],
                'rules' => ['required', 'min:1', 'max:1']
            ],
        ]

        ...
    ]
```

### Step 6: Add languages

[](#step-6-add-languages)

In your "config\\app.php" add multilanguage locales (use ISO language codes). For example:

```
    'locales' => [
        "us" => "USA",
        "uk" => "Great Britain",
        "ca" => "Canada",
        "au" => "Australia",
        "de" => "German",
        "at" => "Austria",
    ],
```

Frontend part
-------------

[](#frontend-part)

### Step 7: Frontend part

[](#step-7-frontend-part)

Add helper function to "composer.json" file

```
        "autoload": {
            "files": [
                "vendor/trinityrank/multilanguage/src/Frontend/helpers.php"
            ],
            ...
        }
```

And then run:

```
    composer dump-autoload
```

And change default "route()" method to "multilang\_route()"

### Step 8: Add languages

[](#step-8-add-languages)

In your "config\\app.php" add multilanguage locales (use ISO language codes). For example:

```
    'locales' => ['us', 'uk', 'ca', 'au', 'de', 'at'],
```

### Step 9: Add hreflang metatags

[](#step-9-add-hreflang-metatags)

- For hreflang metatags add this to yout `master.blade` file in head tag

```

    {!! Trinityrank\Multilanguage\Frontend\HreflangDisplay::meta_tags($item) !!}
```

- At the bottom of `app.php` add this part of code and change values according to the website settings

```
    // Url structure scheme (same as multicore tenant config file)
    'services' => [
        'deals' => false,
        'MoneyPage' => [
            'include_category_in_url' => false,
            'slug' => 'best',
        ],
        'News' => [
            'include_category_in_url' => false,
            'slug' => 'news',
        ],
        'Blog' => [
            'include_category_in_url' => false,
            'slug' => false,
        ],
        'ReviewPage' => [
            'include_category_in_url' => false,
            'slug' => 'reviews',
        ]
    ],
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 91.7% 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 ~15 days

Recently: every ~71 days

Total

21

Last Release

1273d ago

Major Versions

v0.3.10 → v1.0.02022-11-22

### Community

Maintainers

![](https://www.gravatar.com/avatar/0529d66a2bad86fe77ead9c9cd33d611daaa00dcc73510603b17bab69b8ea196?d=identicon)[trinity-rank](/maintainers/trinity-rank)

---

Top Contributors

[![nebojsa-trinityrank](https://avatars.githubusercontent.com/u/87073514?v=4)](https://github.com/nebojsa-trinityrank "nebojsa-trinityrank (33 commits)")[![trinity-rank](https://avatars.githubusercontent.com/u/87767187?v=4)](https://github.com/trinity-rank "trinity-rank (3 commits)")

---

Tags

laravelmultilanguagenovaalternatetrinityrank

### Embed Badge

![Health badge](/badges/trinityrank-multilanguage/health.svg)

```
[![Health](https://phpackages.com/badges/trinityrank-multilanguage/health.svg)](https://phpackages.com/packages/trinityrank-multilanguage)
```

###  Alternatives

[spatie/nova-translatable

Making Nova fields translatable

2231.5M1](/packages/spatie-nova-translatable)[outl1ne/nova-translatable

A laravel-translatable extension for Laravel Nova.

203416.9k8](/packages/outl1ne-nova-translatable)[outl1ne/nova-translations-loader

This Laravel Nova package helps developers load translations into their packages.

395.1M42](/packages/outl1ne-nova-translations-loader)[badinansoft/nova-language-switch

A Laravel Nova package to switch language in your application

26506.4k1](/packages/badinansoft-nova-language-switch)[optimistdigital/nova-lang

A Laravel Nova tool.

1411.9k](/packages/optimistdigital-nova-lang)[optimistdigital/nova-locale-manager

Laravel Nova tool to manage locales.

167.0k](/packages/optimistdigital-nova-locale-manager)

PHPackages © 2026

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