PHPackages                             megaezz/laravel-eloquent-localizable - 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. megaezz/laravel-eloquent-localizable

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

megaezz/laravel-eloquent-localizable
====================================

Retrieve the value of a localizable attribute based on the current locale.

v1.0.0(1y ago)068MITPHP

Since Feb 16Pushed 1y ago1 watchersCompare

[ Source](https://github.com/megaezz/laravel-eloquent-localizable)[ Packagist](https://packagist.org/packages/megaezz/laravel-eloquent-localizable)[ RSS](/packages/megaezz-laravel-eloquent-localizable/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Laravel Eloquent Localizable
============================

[](#laravel-eloquent-localizable)

A simple trait for making Eloquent models localizable in Laravel. This trait allows you to easily manage model attributes in different languages by using the current locale or a fallback locale.

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

[](#installation)

1. Install the package via Composer:

```
composer require megaezz/laravel-eloquent-localizable
```

2. Apply the Localizable trait to your Eloquent model:

```
use Megaezz\LaravelEloquentLocalizable\Localizable;

class Article extends Model
{
    use Localizable;

    protected $localizable = ['title', 'description'];
    // Optionally, specify fallback locale, or the one defined in app.locale will be used.
    protected $fallback_locale = 'en';
}

```

Make sure your database table contains the necessary fields for each localized attribute. For example:
------------------------------------------------------------------------------------------------------

[](#make-sure-your-database-table-contains-the-necessary-fields-for-each-localized-attribute-for-example)

```
•	title_en, title_ru
•	description_en, description_ru

```

Retrieving Localized Attributes
-------------------------------

[](#retrieving-localized-attributes)

Once the trait is applied, you can access the localizable attributes like usual. The value returned will be based on the current locale of the application:

```
$article->title; // Will return the title based on the current locale or fallback value
$article->description; // Will return the description based on the current locale or fallback value

```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance43

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

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

451d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/63825aaf3a826f829de7c1be507bc540ab155bd7f52379416348a2b828626b54?d=identicon)[megaezz](/maintainers/megaezz)

### Embed Badge

![Health badge](/badges/megaezz-laravel-eloquent-localizable/health.svg)

```
[![Health](https://phpackages.com/badges/megaezz-laravel-eloquent-localizable/health.svg)](https://phpackages.com/packages/megaezz-laravel-eloquent-localizable)
```

###  Alternatives

[symfony/translation

Provides tools to internationalize your application

6.6k836.5M2.1k](/packages/symfony-translation)[nesbot/carbon

An API extension for DateTime that supports 281 different languages.

169661.4M4.8k](/packages/nesbot-carbon)[joedixon/laravel-translation

A tool for managing all of your Laravel translations

717911.4k11](/packages/joedixon-laravel-translation)[illuminate/translation

The Illuminate Translation package.

6936.4M495](/packages/illuminate-translation)[lajax/yii2-translate-manager

Translation management extension for Yii 2

227578.8k13](/packages/lajax-yii2-translate-manager)[larswiegers/laravel-translations-checker

Make sure your laravel translations are checked and are included in all languages.

256423.2k2](/packages/larswiegers-laravel-translations-checker)

PHPackages © 2026

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