Add translations to your Eloquent models
nevadskiy/laravel-translatable is a Laravel package for add translations to your eloquent models.
It currently has 21 GitHub stars and 22.213 downloads on Packagist (latest version 0.10.0).
Install it with composer require nevadskiy/laravel-translatable.
Discover more Laravel packages by nevadskiy
or browse all Laravel packages to compare alternatives.
Last updated
$book = new Book()
$book->translator()->set('title', 'Fifty miles', 'en')
$book->translator()->set('title', "ะ'ััะดะตััั ะฒะตัััะพะฒ", 'uk')
$book->save();
app()->setLocale('en');
echo $book->title; // Fifty miles
app()->setLocale('uk');
echo $book->title; // ะ'ััะดะตััั ะฒะตัััะพะฒ
7.2 or newer7.0 or newerInstall the package via composer:
composer require nevadskiy/laravel-translatable
Documentation for the package can be found in the Wiki section.
Please see CHANGELOG for more information what has changed recently.
Thank you for considering contributing. Please see CONTRIBUTING for more information.
The MIT License (MIT). Please see LICENSE for more information.