PHPackages                             motwreen/translation - 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. motwreen/translation

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

motwreen/translation
====================

A simple GUI for Laravel Translation.

1.1.0(5y ago)3582MITPHP

Since Jun 19Pushed 5y ago2 watchersCompare

[ Source](https://github.com/motwreen/translation)[ Packagist](https://packagist.org/packages/motwreen/translation)[ Docs](https://motwreen.com)[ RSS](/packages/motwreen-translation/feed)WikiDiscussions master Synced 3d ago

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

Laravel Translation
===================

[](#laravel-translation)

A simple GUI for Laravel Translation.

This package will allows you to take control of `lang` files in Laravel infrastructre . it will also allows you to translate user inputs (models or database columns data)

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

[](#installation)

So simple just run `composer require motwreen/translation` in your application terminal.

Publish
-------

[](#publish)

If you'd like to edit package views run `php artisan vendor:publish --tag=motwreen-translation` in your terminal and you'll find it in this path : `resources/views/vendor/translation`.

Routes
------

[](#routes)

you can include translations routes in your application like this in `web.php` file.

```
$options = ['prefix'=>'admin/translation/','middleware'=>['web','auth:admin']];
Translations::routes($options);

```

Migrate
-------

[](#migrate)

To migrate database tables run `php artisan migrate`

Using GUI
---------

[](#using-gui)

- after installation you can access translation gui with `http://app-url.dev/translation`.
- create your languages and translate them.
- you can use (.) dot syntax to defind multidimensional array in lang file like this in `key` field:

```
level1.level2.level3.level4.etc

```

which will produce this result in lang file

```
'level1' => [
        'level2' => [
            'level3' => [
                'level4' => 'etc',
            ],
        ],
    ],

```

Database translation
--------------------

[](#database-translation)

- To start using database translations in your models use this trait `Motwreen\Translation\Traits\TranslatableTrait`.
- define a protected `$translatable` array in your model class like this :

```
