PHPackages                             internetguru/laravel-translatable - 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. internetguru/laravel-translatable

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

internetguru/laravel-translatable
=================================

v0.2.3(2mo ago)0515MITPHPCI passing

Since Oct 28Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/internetguru/laravel-translatable)[ Packagist](https://packagist.org/packages/internetguru/laravel-translatable)[ RSS](/packages/internetguru-laravel-translatable/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (10)Used By (0)

Laravel Translatable
====================

[](#laravel-translatable)

A Laravel package for translating Eloquent model attributes.

BranchStatusCode CoverageMain[![tests](https://github.com/internetguru/laravel-translatable/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/internetguru/laravel-translatable/actions/workflows/test.yml/badge.svg?branch=main)[![coverage](https://raw.githubusercontent.com/internetguru/laravel-translatable/refs/heads/badges/main-coverage.svg)](https://raw.githubusercontent.com/internetguru/laravel-translatable/refs/heads/badges/main-coverage.svg)Staging[![tests](https://github.com/internetguru/laravel-translatable/actions/workflows/test.yml/badge.svg?branch=staging)](https://github.com/internetguru/laravel-translatable/actions/workflows/test.yml/badge.svg?branch=staging)[![coverage](https://raw.githubusercontent.com/internetguru/laravel-translatable/refs/heads/badges/staging-coverage.svg)](https://raw.githubusercontent.com/internetguru/laravel-translatable/refs/heads/badges/staging-coverage.svg)Dev[![tests](https://github.com/internetguru/laravel-translatable/actions/workflows/test.yml/badge.svg?branch=dev)](https://github.com/internetguru/laravel-translatable/actions/workflows/test.yml/badge.svg?branch=dev)[![coverage](https://raw.githubusercontent.com/internetguru/laravel-translatable/refs/heads/badges/dev-coverage.svg)](https://raw.githubusercontent.com/internetguru/laravel-translatable/refs/heads/badges/dev-coverage.svg)Installation
------------

[](#installation)

1. Install the package via Composer:

    ```
    # First time installation
    composer require internetguru/translatable
    # For updating the package
    composer update internetguru/translatable
    ```

Run Tests Locally
-----------------

[](#run-tests-locally)

In Visual Studio Code you can simpy use `Ctrl+Shift+B` to run the tests.

To run the tests manually, you can use the following commands:

```
# Build the Docker image
docker build -t laravel-translatable .
# Run the tests
docker run --rm laravel-translatable
# Both steps combined
docker build -t laravel-translatable . && docker run --rm laravel-translatable
```

Usage
-----

[](#usage)

1. Add the `Translatable` trait to your Eloquent model:

    ```
    use InternetGuru\Translatable\Translatable;

    class Room extends Model
    {
        use Translatable;
    }
    ```
2. Define the translatable attributes in the model. Do not use `$fillable` for translatable attributes:

    ```
    protected $translatable = ['name'];
    ```
3. Use translatable attributes:

    ```
    app()->setLocale('en');
    app()->setFallbackLocale('en');

    $room = new Room();
    $room->save();

    // No translation set
    echo $room->name; // null

    $room->name = 'Living Room';
    echo $room->name; // Living Room

    app()->setLocale('cs');
    $room->name = 'Obývací pokoj';
    echo $room->name; // Obývací pokoj

    app()->setLocale('en');
    echo $room->name; // Living Room

    app()->setLocale('cs');
    echo $room->name; // Obývací pokoj

    // Fallback to the fallback locale
    app()->setLocale('de');
    echo $room->name; // Living Room

    // Fallback to the first translation if fallback locale not found
    app()->setFallbackLocale('fr');
    echo $room->name; // Living Room
    ```

License &amp; Commercial Terms
------------------------------

[](#license--commercial-terms)

### License

[](#license)

Copyright © 2026 **Internet Guru**

This software is licensed under the [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)](http://creativecommons.org/licenses/by-nc-sa/4.0/) license.

> **Disclaimer:** This software is provided "as is", without warranty of any kind, express or implied. In no event shall the authors or copyright holders be liable for any claim, damages or other liability.

### Commercial Use

[](#commercial-use)

The standard CC BY-NC-SA license prohibits commercial use. If you wish to use this software in a commercial environment or product, we offer **flexible commercial licenses** tailored to:

- Your company size.
- The nature of your project.
- Your specific integration needs.

**Note:** In many instances (especially for startups or small-scale tools), this may result in no fees being charged at all. Please contact us to obtain written permission or a commercial agreement.

**Contact for Licensing:**

### Professional Services

[](#professional-services)

Are you looking to get the most out of this project? We are available for:

- **Custom Development:** Tailoring the software to your specific requirements.
- **Integration &amp; Support:** Helping your team implement and maintain the solution.
- **Training &amp; Workshops:** Seminars and hands-on workshops for your developers.

Reach out to us at  — we are more than happy to assist you!

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance85

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 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 ~97 days

Recently: every ~121 days

Total

6

Last Release

76d ago

### Community

Maintainers

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

---

Top Contributors

[![petrzpav](https://avatars.githubusercontent.com/u/1113912?v=4)](https://github.com/petrzpav "petrzpav (48 commits)")

---

Tags

attributeseloquentlaraveltranslation

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/internetguru-laravel-translatable/health.svg)

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

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11320.2M21](/packages/anourvalar-eloquent-serialize)[overtrue/laravel-versionable

Make Laravel model versionable.

585308.0k5](/packages/overtrue-laravel-versionable)[abbasudo/laravel-purity

elegant way to add filter and sort in laravel

514330.5k1](/packages/abbasudo-laravel-purity)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135192.6k5](/packages/statamic-rad-pack-runway)[dragon-code/laravel-deploy-operations

Performing any actions during the deployment process

240173.5k2](/packages/dragon-code-laravel-deploy-operations)[stayallive/laravel-eloquent-observable

Register Eloquent model event listeners just-in-time directly from the model.

2928.9k7](/packages/stayallive-laravel-eloquent-observable)

PHPackages © 2026

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