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

twg_'s avatar
Level 6

Autopublishing Laravel app with .env

Hi,

I'm using forge to push out my first project. When I push to my repo of course the .env file is left out since it's my production .env file. What's the best way to push changes and have a production env file?

0 likes
3 replies
aurawindsurfing's avatar
Level 50

Hi @twg_

You just edit .env directly in Forge site settings. Since it is ignored in your git it will not be overwritten or changed on each commit. This is how most people do it.

Hope it helps!

1 like
twg_'s avatar
Level 6

Awesome. That's what I was doing but wanted to make sure there wasn't something I was missing. Thanks @aurawindsurfing.

Nice IT Crowd avatar. I was just watching an episode.

Please or to participate in this conversation.