nevadskiy/laravel-translatable
Add translations to your Eloquent models
🍬 Features
- Translatable attributes behave like regular model attributes.
- Full support for accessors, mutators and casts (even JSON).
- Fallback translations.
- 4 different strategies for storing translations.
📺 Quick demo
$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; // П'ятдесят верстов
✅ Requirements
- PHP
7.2or newer - Laravel
7.0or newer - Can work with Octane
🔌 Installation
Install the package via composer:
composer require nevadskiy/laravel-translatable
📑 Documentation
Documentation for the package can be found in the Wiki section.
📄 Changelog
Please see CHANGELOG for more information what has changed recently.
☕ Contributing
Thank you for considering contributing. Please see CONTRIBUTING for more information.
📜 License
The MIT License (MIT). Please see LICENSE for more information.
Related Packages
zash/laravel-translations-db
A database translations implementation for Laravel 5, forked from hpolthof/larav...
171
1
kkomelin/laravel-translatable-string-exporter
Translatable String Exporter for Laravel
1,722,811
330
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| 0.10.0 | ^7.2| | >=7.0 | MIT | |
| 0.9.0 | ^7.2| | ^7.0| | MIT | |
| 0.8.1 | ^7.2| | ^7.0| | MIT | |
| 0.8.0 | ^7.2| | ^7.0| | MIT | |
| 0.7.4 | ^7.2| | ^7.0| | MIT | |
| 0.7.3 | ^7.2| | ^7.0| | MIT | |
| 0.7.2 | ^7.2| | ^7.0| | MIT | |
| 0.7.1 | ^7.2| | ^7.0| | MIT | |
| 0.7.0 | ^7.2| | ^7.0| | MIT | |
| 0.6.0 | ^7.2 | ^7.0| | MIT | |
| 0.5.0 | ^7.2 | ^7.0| | MIT | |
| 0.4.0 | ^7.2 | ^7.0 | MIT | |
| 0.3.0 | ^7.2 | ^7.0 | MIT | |
| 0.2.0 | ^7.2 | ^7.0 | MIT | |
| 0.1.0 | ^7.2 | ^7.0 | MIT |