delta-solutions / translations
Store your spatie/laravel-translation-loader powered translations in columns instead of in a json field
Requires
- php: ^7.2|^8.0|^8.1
- illuminate/contracts: ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
- spatie/laravel-package-tools: ^1.12.0|^1.14.0
- spatie/laravel-translation-loader: ^2.0
Requires (Dev)
- laravel/pint: ^1.0
README
Translations in columns loader
This package provides a migration and a model to extend the spatie/laravel-translation-loader so you can store your translations in columns instead of one json field. One column per locale.
Installation
You can install the package via composer:
composer require delta-solutions/translations
Follow the installation steps as explained in the Spatie docs https://github.com/spatie/laravel-translation-loader
Define the locales in the translation-loader.php
config file, one locale per database column. This is used in the migration to create the database fields.
'locales' => ['nl', 'fr', 'en', 'de', 'es']
You can publish and run the migrations with:
php artisan vendor:publish --tag="translations-migrations"
php artisan migrate
This will create the fields in your database as specified in the locales array
Use the model from this package as the model for the spatie/laravel-translation-loader. This is configured via the model
in the config. Change it to
'model' => DeltaSolutions\Translations\Models\LanguageLine::class,
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.