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

arketekt's avatar

Sharing Envoyer Deployment Hooks

Hello. I was new to Envoyer and Laravel in general and was hoping someone would be willing to share their Deployment Hooks with me. Based on what I've read from docs I believe I do have the correct hooks already in place but I'd rather be safe than sorry and get the advice from more experienced devs here. Currently my deployment looks like this:

cd {{release}}

php artisan route:cache
php artisan config:cache
cd {{release}}

npm install --dev && npm install --prod
cd {{release}}

npm run production
cd {{release}}

php artisan migrate --force
cd {{release}}

php artisan optimize

based on an article I read it mentioned you would also need to install npm dev dependencies but I'm not sure why that is. Anyhow that's my current configuration, the app does deploy as expected but if I do have an error or doing something I shouldn't or even better if someone here in the community has a better way to do it I'd really appreciate learning how it's done. Thank you.

0 likes
0 replies

Please or to participate in this conversation.