Level 18
While not ideal, you can use exec to execute the command.
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
i'm working on automatic app upgrader class where i can automatically download/unzip upgrade files.
my code is working just fine and things are looking good apart from compiling assets.
basically i need to run this programmatically from a model class after setting up the upgraded files on customer hosting account?
So typically i can manually run
npm run production
My question is how to run NPM commands directly from a model class???
is that possible ???
any recommendations ????
While not ideal, you can use exec to execute the command.
Please or to participate in this conversation.