Hi, I had a Codementor session with screen sharing and in the process of helping me my mentor saw my .env file which has my APP_KEY.
I don’t really understand what the APP_KEY is for so what I would like to know please, is could any harm be done as a result of it being seen? If yes, what harm could be done? And what should I do now, please?
Thanks @bashy and @shahinul87. He only saw my local .env file so I figured no harm could be done from seeing the local db login details? My production environment variables are in Laravel Forge so he didn't see them.
I just realized I don't have an APP_KEY environment variable for my production environment (because my APP_KEY is in my local .env file which gets ignored by git) and my app has been working fine without ever creating one.
Should I have an APP_KEY for my production environment, too?
When you say the APP_KEY should be separate to production, do you mean I have a production APP_KEY somewhere? In Forge? Where would I find this please? I just want to know my production APP_KEY isn't the same as the APP_KEY he saw in my local .env file. When I ran php artisan key:generate to change it, I did that from homestead in the command line so I suppose that wouldn't have changed my production APP_KEY (if it exists).
I've not used Forge myself but you should set the environment variables somewhere (including the APP_KEY).
It's along with all the DB credentials as well.