PHPackages                             mphpmaster/laravel-model-translation-helpers - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. mphpmaster/laravel-model-translation-helpers

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mphpmaster/laravel-model-translation-helpers
============================================

Laravel model translation helpers.

1.0.0(2y ago)14MITPHPPHP &gt;=8.1

Since Jun 11Pushed 2y ago1 watchersCompare

[ Source](https://github.com/mPhpMaster/laravel-model-translation-helpers)[ Packagist](https://packagist.org/packages/mphpmaster/laravel-model-translation-helpers)[ RSS](/packages/mphpmaster-laravel-model-translation-helpers/feed)WikiDiscussions main Synced 1mo ago

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

Laravel model translation helpers
=================================

[](#laravel-model-translation-helpers)

Dependencies:
-------------

[](#dependencies)

- php &gt;=8.1 **REQUIRED IN YOUR PROJECT**
- laravel &gt;=8 **REQUIRED IN YOUR PROJECT**
- laravel/helpers ^1.5 *composer will install it automatically*

Installation:
-------------

[](#installation)

```
composer require mphpmaster/laravel-model-translation-helpers
```

Usage:
------

[](#usage)

1. Add trait to your model class (**REQUIRED**):

```
use \MPhpMaster\LaravelModelTranslationHelpers\Traits\TModelTranslation;
```

2. Override this method if the model has custom translation filename (**OPTIONAL**):

```
public static function getTranslationKey(): ?string
{
    return str_singular(snake_case((new static)->getTable()));
}
```

3. Create Translation file (**REQUIRED**):

> - Translation file must be under `models` folder in order to use it with this helper.
>
>
> \* Name the file as you defined it with `getTranslationKey` method on step 2, by default the filename must be like model name in snake case.
>
> \*\*Example:\*\*
> If you use default `getTranslationKey` method it will be for model `User` as `user.php`.

```
touch lang/en/models/user.php
```

4. Default translation file will be like:

```

```

5. Use the helper anywhere:

```
// Basic usage
\App\Models\User::trans('singular'); // User
\App\Models\User::trans('plural'); // Users

// fields:
\App\Models\User::trans('fields.email'); // Email
// or
\App\Models\User::trans('email'); // Email

// Advanced Usage:
\App\Models\User::trans('hi_name', [ 'name' => 'mPhpMaster' ], 'en', 'Please Login!'); // Hi, mPhpMaster
```

License
-------

[](#license)

The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

This Helpers is open-sourced software licensed under the [MIT license](https://github.com/mPhpMaster/laravel-model-translation-helpers/blob/master/LICENSE).

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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

1072d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/653f207f1b16ec4055eea8fd8699991febd6a1a0201011ab3d1a6ece3bbfd511?d=identicon)[mPhpMaster](/maintainers/mPhpMaster)

---

Top Contributors

[![mPhpMaster](https://avatars.githubusercontent.com/u/59211285?v=4)](https://github.com/mPhpMaster "mPhpMaster (1 commits)")

---

Tags

laravelhelpertranslationmodel

### Embed Badge

![Health badge](/badges/mphpmaster-laravel-model-translation-helpers/health.svg)

```
[![Health](https://phpackages.com/badges/mphpmaster-laravel-model-translation-helpers/health.svg)](https://phpackages.com/packages/mphpmaster-laravel-model-translation-helpers)
```

###  Alternatives

[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

22.8k69.3k](/packages/grumpydictator-firefly-iii)[firefly-iii/data-importer

Firefly III Data Import Tool.

7545.8k](/packages/firefly-iii-data-importer)[iteks/laravel-enum

A comprehensive Laravel package providing enhanced enum functionalities, including attribute handling, select array conversions, and fluent facade interactions for robust enum management in Laravel applications.

2516.7k](/packages/iteks-laravel-enum)

PHPackages © 2026

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