This Command Generate All Files In Lang Folder To Json File And Make Auto Generate If Any File Changed .
- Copy TransLangToJs.php To Your Project At
App/Console/Commands
- Open vite.config.js Then At The Top Of File Add
import { exec } from "node:child_process";
- And At The End Of Plugins Add
{
name: "lang",
enforce: "post",
handleHotUpdate({ server, file }) {
if (file.includes("/lang/")) {
exec(
"php artisan lang:run",
(error, stdout) =>
error === null &&
console.log(`Lang Generated Successfully !`)
);
}
},
},
- Congratulations You Have Now Auto Generated For Lang Folder