PHPackages                             samehdoush/laravel-translations-api - 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. samehdoush/laravel-translations-api

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

samehdoush/laravel-translations-api
===================================

Manage translations in laravel without ui and via api links

v0.0.4(1y ago)3149[2 PRs](https://github.com/samehdoush/laravel-translations-api/pulls)MITPHPPHP ^8.1

Since Jul 16Pushed 1y ago2 watchersCompare

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

READMEChangelog (4)Dependencies (9)Versions (7)Used By (0)

Manage translations in laravel without ui and via api links
===========================================================

[](#manage-translations-in-laravel-without-ui-and-via-api-links)

[![Latest Version on Packagist](https://camo.githubusercontent.com/948f5af11410123eb40ce373df53d31cc3f2c699b28359eb03975bd002dc7562/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73616d6568646f7573682f6c61726176656c2d7472616e736c6174696f6e732d6170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/samehdoush/laravel-translations-api)[![GitHub Tests Action Status](https://camo.githubusercontent.com/b1afffd0598fe402389ffb3d9a322413ac9a0400bb06da383d42faa9a5c8b6f2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f73616d6568646f7573682f6c61726176656c2d7472616e736c6174696f6e732d6170692f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/samehdoush/laravel-translations-api/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/51ea32e06d63a470ce406964ff7eba7d2314efea36000b6660fb2b3ca1c5dd9c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f73616d6568646f7573682f6c61726176656c2d7472616e736c6174696f6e732d6170692f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/samehdoush/laravel-translations-api/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/6a8272412552942c013e53163a71bb4fe9d4bdf08409824ba6e64ecac6f59028/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73616d6568646f7573682f6c61726176656c2d7472616e736c6174696f6e732d6170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/samehdoush/laravel-translations-api)

Simple and developer friendly for easy translation management and higher capabilities

Support us
----------

[](#support-us)

[![](https://camo.githubusercontent.com/2929243fb4eda19ba4d9ca3f38e9fd73401a03728524cfb9a16c9dafc45619ba/68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f6c61726176656c2d7472616e736c6174696f6e732d6170692e6a70673f743d31)](https://spatie.be/github-ad-click/laravel-translations-api)

We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).

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

[](#installation)

You can install the package via composer:

```
composer require samehdoush/laravel-translations-api
```

Auto install
------------

[](#auto-install)

```
php artisan translations-api:install
```

OR
--

[](#or)

You can publish and run the migrations with:

```
php artisan vendor:publish --tag="translations-api-migrations"
php artisan migrate
```

You can publish the config file with:

```
php artisan vendor:publish --tag="translations-api-config"
```

This is the contents of the published config file:

```
return [
    /*
    |--------------------------------------------------------------------------
    | Source Language
    |--------------------------------------------------------------------------
    |
    | This is the language that will be used as the source language for
    | the translations. This language will be used to import the
    | translations from the files.
    |
    */
    'source_language' => env('TRANSLATIONS_SOURCE_LANGUAGE', 'en'),

    /*
     * Language lines will be fetched by these loaders. You can put any class here that implements
     * the Samehdoush\LaravelTranslationsApi\TranslationLoaders\TranslationLoader-interface.
     */
    'translation_loaders' => [
        Samehdoush\LaravelTranslationsApi\TranslationLoaders\Db::class,
    ],
    /*
     * This is the model used by the Db Translation loader. You can put any model here
     * that extends  Samehdoush\LaravelTranslationsApi\Models\Phrase.
     */
    'model' => Samehdoush\LaravelTranslationsApi\Models\Phrase::class,

    /*
     * This is the translation manager which overrides the default Laravel `translation.loader`
     */
    'translation_manager' => Samehdoush\LaravelTranslationsApi\TranslationLoaderManager::class,
    /*
    |--------------------------------------------------------------------------
    | Exclude Files
    |--------------------------------------------------------------------------
    |
    | The following files will be ignored during the import process.
    | and those files will be ignored in every language.
    |
    */
    'exclude_files' => [
        //'validation.php', // Exclude default validation for example.
    ],

    /*
    |--------------------------------------------------------------------------
    | Laravel Translations Path
    |--------------------------------------------------------------------------
    |
    | The default is `translations` but you can change it to whatever works best and
    | doesn't conflict with the routing in your application.
    |
    */
    'route_prefix' => env('TRANSLATIONS_PATH', 'translations'),

    /*
    |--------------------------------------------------------------------------
    | Laravel Translations route middleware
    |--------------------------------------------------------------------------
    |
    | These middleware will be assigned to every Laravel Translations route, giving you
    | the chance to add your own middleware to this list or change any of
    | the existing middleware. Or, you can simply stick with this list.
    |
    */

    'middleware' => ['api', 'auth:sanctum'],

    /*
    |--------------------------------------------------------------------------
    | Database Connection
    |--------------------------------------------------------------------------
    |
    | The database connection that should be used to store the imported
    | translations You may specify the connection as a string
    | which is the name of the connection in the database.php file
    |
    */
    'database_connection' => env('TRANSLATIONS_DB_CONNECTION', null),
];
```

Usage
-----

[](#usage)

To import your translations, run the following command:

```
php artisan translations:import
```

To import and overwrite all previous translations, use the following command:

```
php artisan translations:import --fresh
```

#### Exporting Translations

[](#exporting-translations)

To export your translations, run the following command:

```
php artisan translations:export
```

Get translations
----------------

[](#get-translations)

```
/api/translations GET METHOD
return [
    [
            'installed' => boolean,
            'translations' => Object,
        ]
]
```

delete translation
------------------

[](#delete-translation)

```
/api/translations/delete/{translation} DELETE METHOD
```

get progress translation
------------------------

[](#get-progress-translation)

```
/api/translations/{translation}/progress GET METHOD

return [
    [
            'percentage' => float,
        ]
```

create new Source key
---------------------

[](#create-new-source-key)

```
/api/translations/createSourceKey POST METHOD
  Body :     [
            'key' => 'required',
            'file' => 'required',
            'key_translation' => 'required',
        ]
```

create new Translation
----------------------

[](#create-new-translation)

```
/api/translations/createTranslation POST METHOD
  Body :     [
            'language' => 'required|exists:ltu_languages,id',
  ]
```

GET phrases
-----------

[](#get-phrases)

```
/api/translations/phrases/{translation} GET METHOD
  RETURN :     [
            'phrases' => Object,
  ]
```

show phrase
-----------

[](#show-phrase)

```
/api/translations/phrases/{translation}/edit/{phrase:uuid} GET METHOD
  RETURN :     [
            'phrase' => Object,
            'translation' => Object,
        ]
```

update phrase
-------------

[](#update-phrase)

```
/api/translations/phrases/{translation}/edit/{phrase:uuid} put METHOD
  BODY :     [
            'value' => 'required',
        ]
```

DELETE phrase
-------------

[](#delete-phrase)

```
/api/translations/phrases/{translation}/delete/{phrase:uuid} delete METHOD
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [sameh doush](https://github.com/samehdoush)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance42

Moderate activity, may be stable

Popularity14

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.9% 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 ~182 days

Total

4

Last Release

484d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2c15e375de9134defa30a075f635514e7b5d27af9bdb0c63a156273da5995e10?d=identicon)[samehdoush](/maintainers/samehdoush)

---

Top Contributors

[![samehdoush](https://avatars.githubusercontent.com/u/48515888?v=4)](https://github.com/samehdoush "samehdoush (47 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

laravellocalizationtranslationstranslation-managersamehdoushlaravel-translations-api

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/samehdoush-laravel-translations-api/health.svg)

```
[![Health](https://phpackages.com/badges/samehdoush-laravel-translations-api/health.svg)](https://phpackages.com/packages/samehdoush-laravel-translations-api)
```

###  Alternatives

[outhebox/laravel-translations

Manage your Laravel translations with a beautiful UI. Add, edit, delete, import, and export translations with ease.

80687.6k](/packages/outhebox-laravel-translations)[andrewdwallo/transmatic

Automate and streamline real-time text translations in your Laravel applications

5511.6k](/packages/andrewdwallo-transmatic)[elegantly/laravel-translator

All on one translations management for Laravel

6216.9k](/packages/elegantly-laravel-translator)[smousss/laravel-globalize

Make Laravel projects translatable in a matter of seconds!

2266.3k](/packages/smousss-laravel-globalize)

PHPackages © 2026

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