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

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

arthedain/translation
=====================

A Laravel Nova Translation tool.

1.0.0(5y ago)0192MITVuePHP &gt;=7.1.0

Since Mar 5Pushed 5y ago1 watchersCompare

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

READMEChangelog (10)DependenciesVersions (13)Used By (0)

Arthedain/Translation
=====================

[](#arthedaintranslation)

```
composer require arthedain/translation

```

Then include in NovaServiceProvider

```
public function tools()
{
    return [
        new Translation,
    ];
}

```

##### Publish migrations

[](#publish-migrations)

```
php artisan vendor:publish --provider="Arthedain\Translation\TranslationServiceProvider" --tag="migration"

```

> In migration you can change or add fields except `custom_properties` field

##### Publish model

[](#publish-model)

```
php artisan vendor:publish --provider="Arthedain\Translation\TranslationServiceProvider" --tag="model"

```

##### Publish config

[](#publish-config)

```
php artisan vendor:publish --provider="Arthedain\Translation\TranslationServiceProvider" --tag="config"

```

##### Publish editor skin

[](#publish-editor-skin)

```
php artisan vendor:publish --provider="Arthedain\Translation\TranslationServiceProvider" --tag="tinymce"

```

How to use
----------

[](#how-to-use)

```
\App\Models\Translation::locale('some text to add in db', ['tab' => 'All', 'editor' => false, 'key' => false]);
```

> `tab` optinal **string** parameter, create group of fields. The default is `All`

The value of the `tab` parameter can be changed in the localization file

```
"All": "Все"
```

> `editor` optinal **boolean** parameter, sets to use a visual editor or not

For calling method from trait in view use autoload, or other method

```
// composer.json

"autoload": {
    "files": [
        //path to file
    ],
},

// file
