Looking to hire Laravel developers? Try LaraJobs
This package is not available.

laravel-lang-db maintained by shaunthegeek

Description
Manage Laravel translations in the database and export them to JSON files.
Author
Last update
2026/01/30 09:55 (dev-main)
License
Links
Downloads
12

Comments
comments powered by Disqus

Laravel Lang DB

Manage Laravel translations in the database and export them to JSON files.

Installation

composer require shaunthegeek/laravel-lang-db

Usage

  1. Run migrations to create the table:
php artisan vendor:publish --tag=laravel-lang-db-migrations
php artisan migrate
  1. Import translations from /lang directory to database:
php artisan lang:import

This will read all .json files in /lang and populate the database. By default, it skips existing keys. Use --force to update existing records:

php artisan lang:import --force
  1. Add translations to the languages table, either by directly operating the database or via the admin interface (e.g., FilamentPHP).
locale key value
en messages.welcome Welcome
zh_CN messages.welcome 欢迎
  1. Export translations to /lang directory:
php artisan lang:export

This will create/update:

  • /lang/en.json
  • /lang/zh_CN.json

Testing

composer test