Ok, i'm not sure i've got this figured out quite right yet.
Everywhere i look, everyone says not to include your .env file in your repo. This makes sense. What I don't understand is how i'm meant to add the .env to a deployed site.
I'm building a laravel app and trying to deploy through forge. This much works, and then i edit the .env through the forge interface. This seems like a better approach indeed, except whenever another deploy goes through, the .env file gets wiped. So is there a better way to do this or is there a setting i need to check?
So i've found two solutions. One for forge, and one for envoyer.
For forge, I created a recipe that makes the .env file, and this seems to run when forge deploys.
However, the process is different if you use envoyer. In your project, navigate to the servers tab and click manage environment. This allows you to enter your environment variables and feels like a much cleaner way to do this.
Hope this helps any future people struggling with this!