PHPackages                             konnco/laravel-transeloquent - 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. konnco/laravel-transeloquent

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

konnco/laravel-transeloquent
============================

Laravel Eloquent Translatable

v0.1.9-alpha(6y ago)2561MITPHPPHP &gt;=7.2.0CI failing

Since Dec 1Pushed 6y ago1 watchersCompare

[ Source](https://github.com/konnco/laravel-transeloquent)[ Packagist](https://packagist.org/packages/konnco/laravel-transeloquent)[ RSS](/packages/konnco-laravel-transeloquent/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (5)Versions (12)Used By (0)

Laravel Transeloquent
=====================

[](#laravel-transeloquent)

**If you want the faster way to translate your model and store it in a single table, this package is built for you.**

[![Build Status](https://camo.githubusercontent.com/79bfcd8cf7acbd371060b7ac415057aee2193c7d4fe436fedab42d2f5303d450/68747470733a2f2f7472617669732d63692e6f72672f4b6f6e6e636f2f6c61726176656c2d7472616e73656c6f7175656e742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Konnco/laravel-transeloquent)[![Latest Stable Version](https://camo.githubusercontent.com/bd6519ffc9821597d0b26d748ccdf3d20f65636e58e2ceab132cf3533231a95b/68747470733a2f2f706f7365722e707567782e6f72672f6b6f6e6e636f2f6c61726176656c2d7472616e73656c6f7175656e742f762f737461626c65)](https://packagist.org/packages/konnco/laravel-transeloquent)[![Total Downloads](https://camo.githubusercontent.com/f193da653abb9badb18582048aa4e1129ad793e863ab0e503daa9f081c8b54f8/68747470733a2f2f706f7365722e707567782e6f72672f6b6f6e6e636f2f6c61726176656c2d7472616e73656c6f7175656e742f646f776e6c6f616473)](https://packagist.org/packages/konnco/laravel-transeloquent)[![Latest Unstable Version](https://camo.githubusercontent.com/6ebbbaaf331060545bc5be3df3a9136e751a2f9d5c8a4dce501c0a90d0203803/68747470733a2f2f706f7365722e707567782e6f72672f6b6f6e6e636f2f6c61726176656c2d7472616e73656c6f7175656e742f762f756e737461626c65)](https://packagist.org/packages/konnco/laravel-transeloquent)[![License](https://camo.githubusercontent.com/122691ec92b66f90e1b21a8729bb9978675e3c6affe4a4886d82a447578eee24/68747470733a2f2f706f7365722e707567782e6f72672f6b6f6e6e636f2f6c61726176656c2d7472616e73656c6f7175656e742f6c6963656e7365)](https://packagist.org/packages/konnco/laravel-transeloquent)[![StyleCI](https://camo.githubusercontent.com/0044d02de642a122aaa9b67a5189a5ab8c3b55036bbc898df48a79687970c30b/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3232353032373336322f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/225027362)

This is a Laravel package for translatable models. Its goal is to remove the complexity in retrieving and storing multilingual model instances. With this package you write less code, as the translations are being fetched/saved when you fetch/save your instance.

Maybe out there there's so many package that work the same way, and has more performance, but the purpose this package is make your development time faster.

***This package is still in alpha version, so the update may broke your application.***

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

[](#installation)

```
composer require konnco/laravel-transeloquent
```

```
php artisan vendor:publish
```

```
php artisan migrate
```

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

[](#configuration)

you can find transeloquent configuration here. `config/transeloquent.php`

```
return [
    // default locale
    'locale' => 'en',

    // transeloquent model
    'model' => Konnco\Transeloquent\models\Transeloquent::class
];
```

Add transeloquent traits into your model

```
namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class News extends Model {
    use \Konnco\Transeloquent\Transeloquent;
}
```

and the default excluded field is `id`, `created_at`, `updated_at`, `deleted_at` these fields will not saved into database.

if you want to add only some fields to be translated, you may have to add `$translateOnly` into your model.

```
namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Konnco\Transeloquent\Transeloquent;

class News extends Model {
    use Transeloquent;

    protected $translateOnly = ['translate-field-1', 'translate-field-2'];
}
```

if you want to add more excluded field from translated, you may have to add `$translateExcept` into your model.

```
namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Konnco\Transeloquent\Transeloquent;

class News extends Model {
    use Transeloquent;

    protected $translateExcept = ['dont-translate-1', 'dont-translate-2'];
}
```

**Note** : If you have set `$translateOnly` variable, it will be executed first. Make sure you don't use `$translateOnly` variable in your model if you want to use `$translateExcept` variable.

Quick Example
-------------

[](#quick-example)

### Getting translated attributes

[](#getting-translated-attributes)

Original Attributes In English or based on configuration in `app.transeloquent.default_locale`

```
//in the original language
$post = Post::first();
echo $post->title; // My first post
```

---

Translated attributes

```
App::setLocale('id');
$post = Post::first();
echo $post->title; // Post Pertama Saya
```

### Saving translated attributes

[](#saving-translated-attributes)

To save translation you must have the initial data.

for example you want to save indonesian translation.

```
App::setLocale('id');
$post = Post::first();
$post->title = "Post Pertama Saya";
$post->save();

// or set locale for specific model

$post = Post::first();
$post->setLocale('id')
$post->title = "Post Pertama Saya";
$post->save();
```

### Checking if Translation Available

[](#checking-if-translation-available)

```
$post = Post::first();
$post->translationExist('id'); //return boolean
```

Authors
-------

[](#authors)

- **Franky So** - *Initial work* - [Konnco](https://github.com/konnco)
- **Rizal Nasution** - *Initial work* - [Konnco](https://github.com/konnco)

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 91.3% 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 ~10 days

Recently: every ~18 days

Total

10

Last Release

2264d ago

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/2cc4521e9641c59a269f7ec3a670d781681e7d7be8e57be66dafd95d15304693?d=identicon)[frankyso.pg](/maintainers/frankyso.pg)

---

Top Contributors

[![frankyso](https://avatars.githubusercontent.com/u/5705520?v=4)](https://github.com/frankyso "frankyso (63 commits)")[![ijalnasution](https://avatars.githubusercontent.com/u/17308059?v=4)](https://github.com/ijalnasution "ijalnasution (6 commits)")

---

Tags

databaselaravellaravel-5-packagelaravel-transeloquentmultilanguagetranslated-attributestranslationphplaraveltranslatelibraryeloquent

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/konnco-laravel-transeloquent/health.svg)

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

###  Alternatives

[watson/validating

Eloquent model validating trait.

9723.3M47](/packages/watson-validating)[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[spiritix/lada-cache

A Redis based, automated and scalable database caching layer for Laravel

591444.8k2](/packages/spiritix-lada-cache)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)[io238/laravel-iso-countries

Ready-to-use Laravel models and relations for country (ISO 3166), language (ISO 639-1), and currency (ISO 4217) information with multi-language support.

5462.3k](/packages/io238-laravel-iso-countries)[sebastiaanluca/laravel-boolean-dates

Automatically convert Eloquent model boolean attributes to dates (and back).

40111.7k1](/packages/sebastiaanluca-laravel-boolean-dates)

PHPackages © 2026

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