PHPackages                             amir-hossein5/request-translator - 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. amir-hossein5/request-translator

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

amir-hossein5/request-translator
================================

v1.1.0(3y ago)012MITPHPPHP ^8.0

Since May 13Pushed 3y ago1 watchersCompare

[ Source](https://github.com/amirHossein5/request-translator)[ Packagist](https://packagist.org/packages/amir-hossein5/request-translator)[ RSS](/packages/amir-hossein5-request-translator/feed)WikiDiscussions 1.x Synced yesterday

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

Translates intended items of request.

Prerequisites
-------------

[](#prerequisites)

- php 8
- laravel `^8.0|^9.0`

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

[](#installation)

For installing package:

```
composer require amir-hossein5/request-translator
```

For registering middlewares in your project:

```
php artisan translator:install
```

Finally you may create translation file:

```
php artisan make:translation-file
```

Pass a path , or by default a file in `lang` folder, and name `en_request_translation.php`, depens to locale, will be create.

Usage
-----

[](#usage)

Use middleware, and pass intended fields:

```
->middleware('translate:mobile,cash,amount');
```

It will translates them from file `en_request_translation`(en can be your locale, f.g fa\_request\_translation).

Also it accepts "dot" notation:

```
->middleware('translate:user.*,products.desk.price,products.*.price');
```

Change Translation File
-----------------------

[](#change-translation-file)

Pass the path of file which is located in lang folder:

```
->middleware('translate_from:fa/digits_translation.php', 'translate: ....');
```

Templates
---------

[](#templates)

Templates can be for define a group of fields, and you may define them in `RouteServiceProvider`:

```
use AmirHossein5\RequestTranslator\Facades\Translator;

Translator::for('userDigits', [
    'cash', 'phone'
]);
```

```
->middleware('translate:userDigits,amount');
```

Each can have custom file path:

```
use AmirHossein5\RequestTranslator\Facades\Translator;

Translator::for('userDigits', [
    'cash' => 'fa/cash_translation.php',
    'phone'
]);
```

And path may define for all of the fields:

```
use AmirHossein5\RequestTranslator\Facades\Translator;

Translator::for('userDigits', [
    'cash' => 'fa/cash_translation.php',
    'phone',
    'number'
], 'test.php');
```

`cash` will be translate from `fa/cash_translation.php`, and others from `test.php`.

The priority of using translation files:

- In template
- In translate\_from middleware
- Default path(`LOCALE_request_translation.php`)

License
-------

[](#license)

[MIT license](https://opensource.org/licenses/MIT)

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 84.6% 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 ~18 days

Total

3

Last Release

1422d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8965321404f59b9bc2b2ec90f25cc2dd341030cb6863de0d4721a12b239ae079?d=identicon)[amirHossein5](/maintainers/amirHossein5)

---

Top Contributors

[![amirHossein5](https://avatars.githubusercontent.com/u/68776630?v=4)](https://github.com/amirHossein5 "amirHossein5 (11 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (2 commits)")

---

Tags

laravelphptranslator

### Embed Badge

![Health badge](/badges/amir-hossein5-request-translator/health.svg)

```
[![Health](https://phpackages.com/badges/amir-hossein5-request-translator/health.svg)](https://phpackages.com/packages/amir-hossein5-request-translator)
```

###  Alternatives

[eonasdan/bootstrap-datetimepicker

Date/time picker widget based on twitter bootstrap

7.2k492.4k9](/packages/eonasdan-bootstrap-datetimepicker)

PHPackages © 2026

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