a21 / lexicon-client
Laravel client for Lexicon: pull translation JSON exports from a central Lexicon server.
1.0.0
2026-06-26 10:34 UTC
Requires
- php: ^8.1
- illuminate/contracts: ^10.0
- illuminate/http: ^10.0
- illuminate/support: ^10.0
Requires (Dev)
- orchestra/testbench: ^8.0
- phpunit/phpunit: ^10.0
This package is not auto-updated.
Last update: 2026-06-27 08:53:55 UTC
README
Laravel package to connect a client application (Hub, Studio, Gallery…) to a central Lexicon translation server.
Requirements
- PHP 8.1+
- Laravel 10.x
Install (Packagist)
composer require a21/lexicon-client php artisan vendor:publish --tag=lexicon-config php artisan lexicon:init
Configuration
Add to .env (never commit secrets):
LEXICON_API_URL=https://lexicon.a21.com LEXICON_CLIENT_CODE=hub LEXICON_PROJECT_CODE=hub LEXICON_CLIENT_SECRET=lex_sk_live_xxxxxxxx LEXICON_ENVIRONMENT=production
Optional manifest at project root: lexicon.json (no secret in this file).
Commands
| Command | Description |
|---|---|
php artisan lexicon:init |
Create lexicon.json + append .env.example |
php artisan lexicon:status |
Check server connection and project metadata |
php artisan lexicon:export |
Request export bundle from server |
php artisan lexicon:pull |
Export + write JSON files locally |
php artisan lexicon:sync |
Placeholder (source scan coming later) |
Examples:
php artisan lexicon:status php artisan lexicon:pull --all php artisan lexicon:pull --lang=fr --area=catalog --only-approved --dry-run
Server setup
Create an integration client on the Lexicon server (admin API). Copy the secret once, then configure this package.
See the Lexicon server docs: docs/client-package.md, docs/integration-api.md, docs/export-cli.md.
Security
- Keep
LEXICON_CLIENT_SECRETserver-side only (.env). - Never put the secret in
lexicon.jsonor frontend code.
License
MIT