Installation
Install the package in two parts:
erag/laravel-lang-sync-inertiafor the Laravel backend@erag/lang-sync-inertiafor Vue or React frontend usage
Backend package
bash
composer require erag/laravel-lang-sync-inertiabash
npm install @erag/lang-sync-inertiaPublish language files
If your app does not already have published language files, publish them first:
bash
php artisan lang:publishThen publish the package assets and config:
bash
php artisan erag:install-langAfter installation
Once installation is complete:
- Create or update your language files in
lang/{locale}. - Call
syncLangFiles()before returning your Inertia response. - Use
lang()in Vue or React to read translations on the frontend.