PHPackages                             mammut-alex/polyglot - 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. [Database &amp; ORM](/categories/database)
4. /
5. mammut-alex/polyglot

ActiveLibrary[Database &amp; ORM](/categories/database)

mammut-alex/polyglot
====================

Translate model column in laravel

0.2.0(9y ago)21.9kMITPHPPHP &gt;=5.6.4

Since Feb 7Pushed 7y ago1 watchersCompare

[ Source](https://github.com/MammutAlex/polyglot)[ Packagist](https://packagist.org/packages/mammut-alex/polyglot)[ RSS](/packages/mammut-alex-polyglot/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (2)Versions (11)Used By (0)

Polyglot
========

[](#polyglot)

[![Build Status](https://camo.githubusercontent.com/1890b3b65afc344aa206efbd875e0ea955a68186898e7c57264af0dcf40e2f2f/68747470733a2f2f7472617669732d63692e6f72672f4d616d6d7574416c65782f706f6c79676c6f742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/MammutAlex/polyglot)[![Total Downloads](https://camo.githubusercontent.com/6927a0d39a3289f73dd53b9b56c3e7c01395ddccc3774a003b62d0843f2e7095/68747470733a2f2f706f7365722e707567782e6f72672f6d616d6d75742d616c65782f706f6c79676c6f742f646f776e6c6f616473)](https://packagist.org/packages/mammut-alex/polyglot)[![Latest Stable Version](https://camo.githubusercontent.com/d086b59357baff7c503871c585f065699542a26d85d053e955522a747bd93228/68747470733a2f2f706f7365722e707567782e6f72672f6d616d6d75742d616c65782f706f6c79676c6f742f762f737461626c65)](https://packagist.org/packages/mammut-alex/polyglot)[![License](https://camo.githubusercontent.com/8404113feab7936a327147ead138b4dc42188a7aef65085e4bcb1f3e7ca05327/68747470733a2f2f706f7365722e707567782e6f72672f6d616d6d75742d616c65782f706f6c79676c6f742f6c6963656e7365)](https://packagist.org/packages/mammut-alex/polyglot)[![Code Climate](https://camo.githubusercontent.com/d1af0a8a68c0146c4ddf2439d64f8f92f88110b9b43ce544c5e034372d666692/68747470733a2f2f6c696d612e636f6465636c696d6174652e636f6d2f6769746875622f4d616d6d7574416c65782f706f6c79676c6f742f6261646765732f6770612e737667)](https://lima.codeclimate.com/github/MammutAlex/polyglot)[![StyleCI](https://camo.githubusercontent.com/b957bee3a85901ba37b055f727d08a86ca7004828b7616684c8928afedab5a68/68747470733a2f2f7374796c6563692e696f2f7265706f732f38313138363932302f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/81186920)

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

[](#installation)

Require this package in your `composer.json` and update composer.

```
"mammut-alex/polyglot": "0.2.*"
```

or `composer require mammut-alex/polyglot`

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

[](#documentation)

Translator works with a database, it looks for a prefix code language

Here is an example Migration

```
    $table->string('name_en');
    $table->string('name_uk');
    $table->string('name_ru');
```

To use polyglot, connect it to your model and use feature for translation.

```
namespace App;

use Illuminate\Database\Eloquent\Model;
use MammutAlex\Polyglot\Polyglot;

class YouModel extends Model
{
	use Polyglot;

	public function name()
    	{
    		return $this->translation('name');
    	}
    ...
```

The function will return the translation in the selected language user

An example of the use in blade:

```
{{$model->name()}}

```

See more example in tests, documentation being developed

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

Every ~4 days

Total

9

Last Release

3344d ago

PHP version history (2 changes)0.0.1PHP &gt;=5.4.0

0.1.3PHP &gt;=5.6.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/7187f568f504ce09b7512391a19f0a97132739be986b682e125745f8aef480a8?d=identicon)[MammutCris](/maintainers/MammutCris)

---

Top Contributors

[![MammutAlex](https://avatars.githubusercontent.com/u/10599196?v=4)](https://github.com/MammutAlex "MammutAlex (29 commits)")

---

Tags

dblanguagelaravelpolyglottranslationlaraveltranslatedatabasemodel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mammut-alex-polyglot/health.svg)

```
[![Health](https://phpackages.com/badges/mammut-alex-polyglot/health.svg)](https://phpackages.com/packages/mammut-alex-polyglot)
```

PHPackages © 2026

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