neoxia / laravel-database-localization
Use a database source instead of files for localization in Laravel
Installs: 2 605
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 38
Forks: 0
Open Issues: 0
Requires
- php: >=5.5.9
- illuminate/support: ^5.5|6.*
- illuminate/translation: ^5.5|6.*
This package is auto-updated.
Last update: 2024-12-24 21:44:43 UTC
README
Laravel Database Localization
This package allows the storage of Laravel translations in a database instead of files. It is not opinionated about how you store your data (any database, any schema) or how you edit this data. It only overwrite the default translation loading by using a Laravel model that can be specified in the configuration.
Installation
Require this package with composer using the following command:
composer require neoxia/laravel-database-localization
Go to config/app.php
, remove the original service provider
Illuminate\Translation\TranslationServiceProvider::class,
And replace it by this one.
Neoxia\DatabaseLocalization\DatabaseTranslationServiceProvider::class,
Configuration
You can publish a default config file by runnning the artisan command
php artisan vendor:publish
.
Update the configuration with you model class name. This model has to implement the Neoxia\DatabaseLocalization\Translatable
interface.