neoxia / laravel-database-localization by thomasruiz

Use a database source instead of files for localization in Laravel
2,605
2
38
Package Data
Maintainer Username: thomasruiz
Package Create Date: 2017-06-01
Package Last Update: 2021-03-24
Language: PHP
License: MIT
Last Refreshed: 2024-11-22 03:12:47
Package Statistics
Total Downloads: 2,605
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 2
Total Watchers: 38
Total Forks: 0
Total Open Issues: 0

Latest Stable Version

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.