There is already a tool like that: https://laravel.com/docs/8.x/envoy
It won't copy over because that does not make sense having services such as github, but the rest can be automated :)
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
So tl;dr, imagine you have:
/home/dev-laravel
And
/home/prod-laravel
I don't have much experience with custom artisan commands, but is there a way to create a command on the prod side i.e.
php artisan deploy:prod
And then that would take everything but public, node_modules, vendor, dotenv from dev, copy it over the files on prod and run artisan config:cache, composer install, npm install and npm run prod?
Please or to participate in this conversation.