Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

dlook's avatar
Level 4

How to create php artisan custom command

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?

0 likes
2 replies
dlook's avatar
Level 4

Envoy is a really good tool, but unfortunately not what the client wants. They want explicitly the artisan command.

Please or to participate in this conversation.