PHPackages                             vortgo/laravel-translate - 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. vortgo/laravel-translate

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

vortgo/laravel-translate
========================

Translate system for laravel project

1.0.0(8y ago)7951MITPHPPHP &gt;=5.5.0

Since May 27Pushed 8y ago1 watchersCompare

[ Source](https://github.com/vortgo/laravel-translate)[ Packagist](https://packagist.org/packages/vortgo/laravel-translate)[ RSS](/packages/vortgo-laravel-translate/feed)WikiDiscussions master Synced 2d ago

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

[![SensioLabsInsight](https://camo.githubusercontent.com/970474c387cae92ae4fb084461639b793068985b2810a9de46007a4b75b62cac/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f34373563306331342d383533342d343163312d393935322d3037353364366166633731612f736d616c6c2e706e67)](https://insight.sensiolabs.com/projects/475c0c14-8534-41c1-9952-0753d6afc71a)

Translate entity
================

[](#translate-entity)

About package
-------------

[](#about-package)

This package is intended for adding multi language support to your models. If your application already be working and you need to add one or more aditional languages to your content in database it's be easy.

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

[](#installation)

Require this package in your composer.json

```
$ composer reqiure vortgo/laravel-translate

```

Add the service provider to you config file config/app.php

```
Vortgo\Translate\ModelTranslateServiceProvider::class

```

Publish vendor

```
    $ php artisan vendor:publish

```

Run migration to create table for your translatable content

```
$ php artisan migrate

```

Add trait to your model which need to translate and setup your default language for your model

```
    class Category extends Model
    {
        use Translate;
        protected $defaultLocale = 'en';
    }

```

Usage
-----

[](#usage)

You can create entity with translate as usually:

```
        Category::create([
            'name' => 'name',
            'ru' => [
                'name' => 'название'
            ],
            'fr' => [
                'name' => 'fr name'
            ]
        ]);

```

For access the translate value you can use next variant:

Determine when calling

```
    $category->translate('fr')->name

```

Use your app locale

```
    App()->setLocale('fr')
    $category->name

```

Get all translations attributes for current model

```
$category->getTranslations('fr')

```

Bonuses
-------

[](#bonuses)

You can use relations for eager loader your model

```
    App()->setLocale('fr');
    $item = Item::with('category', 'category.rTranslate')->first();
    $item->category->name;

```

To array with relation

```
    App()->setLocale('fr');
    $item = Item::with('category', 'category.rTranslate')->first();
    $item->toArray();
    Result = [
        'id' =>1,
        'item_name' => 'name',
        'category' => [
            'name' => 'fr name'
        ]
    ];

```

If you want to override function `toArray()` use `translateToArray()` in your model

```
    public function toArray()
    {
        $array = $this->translateToArray(); //parent::toArray()

        // Your code here

        return $array;
    }

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

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

3274d ago

### Community

Maintainers

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

---

Top Contributors

[![vortgo](https://avatars.githubusercontent.com/u/13101234?v=4)](https://github.com/vortgo "vortgo (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vortgo-laravel-translate/health.svg)

```
[![Health](https://phpackages.com/badges/vortgo-laravel-translate/health.svg)](https://phpackages.com/packages/vortgo-laravel-translate)
```

###  Alternatives

[mcamara/laravel-localization

Easy localization for Laravel

3.5k9.1M112](/packages/mcamara-laravel-localization)[typicms/base

A modular multilingual CMS built with Laravel, enabling developers to manage structured content like pages, news, events, and more.

1.6k20.3k](/packages/typicms-base)[vemcogroup/laravel-translation

Translation package for Laravel to scan for localisations and up/download to poeditor

135304.0k2](/packages/vemcogroup-laravel-translation)

PHPackages © 2026

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