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

martylamoureux's avatar

[Envoyer] How to migrate using .env ?

Hi everyone,

I just started to set up Envoyer for one of my projects, but I'm stuck with DB migration on deployment...

"php artisan migrate --force" crashed when I run it with a hook after Install Composer Dependencies. It seems that is because the .env is not yet "symlinked" in the release folder.

How can I manage to run the migrations after the .env file is linked ?

0 likes
4 replies
jekinney's avatar

There is a link to create the env file. Copy and paste your code, save and redeploy.

Ozan's avatar

@martylamoureux

Select the Servers tab and click the Manage Environment button. Servers > Manage Environment Enter your password: Enter a private key of yours

Copy your .env file and done! ;)

privatebox's avatar

Ok - I have the symlink set-up correctly from the "current" dir to ".env" however Laravel can't see it for some reason (I get a database connection error as the credentials are wrong).

Permissions look ok. No errors during deploy. One extra deployment hook after composer which consists of

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

Anything else I could be checking?

privatebox's avatar

Don't worry - I fixed with:

php artisan config:cache
php artisan env

Please or to participate in this conversation.