Installation
Requirements
- PHP 8.1 or higher
- Laravel 10.x, 11.x, 12.x, or 13.x
Install via Composer
bash
composer require barisdemirhan/laravel-polyglot-modelPublish Migrations
bash
php artisan vendor:publish --tag="polyglot-model-migrations"
php artisan migratePublish Configuration (Optional)
bash
php artisan vendor:publish --tag="polyglot-model-config"This will create a config/polyglot-model.php file where you can customize:
- Source and fallback locales
- Supported locales list
- Cache settings (TTL, prefix)
- Translation table name
- Custom translation model
- Events toggle
Verify Installation
After installation, you should have:
- A
translationstable in your database - (Optional) A
config/polyglot-model.phpconfiguration file
You're now ready to use the package! Head to the Quick Start guide.