I think the best bet is that you use spatie/ssh for this.
Repo https://github.com/spatie/ssh
$process = Ssh::create('user', 'example.com')->execute([
'first command',
'second command',
]);
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Can anyone tell me how services like forge or envoyer run tasks on our servers? e.g. adding nginx config, running bash scripts, pulling down git repos etc
Basically I am looking to implement a laravel application for working with UHF RFID readers we want to introduce into our business processes, the application will allow admins to create the readers in a db, and then when other applications hit the rest api the server should communicate with the RFID readers or depending on how many we end up with pass the job to other servers.
At the minute the scripts for interacting with the RFID readers will either be coded in node, python or even C# running .net core.
I know i could call shell_exec or use the symfony components to run the scripts from laravel app but i'm interested in how these services do it in case our use case grows significantly.
Thanks
Please or to participate in this conversation.