It is possible to set the environment variable without the .env file. You need to set environments variable on your server but that depends on your system. It is the same idea as if you run env in your Linux shell.
In PHP you can see the variables with $_ENV (See: https://www.php.net/manual/en/reserved.variables.environment.php ) And if I'm correct Laravel will load the variables for you like the .env file.
On the other hand if someone has access to your production server he/she can not only read the .env file but also probably also access your env variable.
Maybe can encrypting your environment variable be interesting for you: https://laravel.com/docs/9.x/configuration#encrypting-environm...
Sign in to participate in this thread!
We'd like to thank these amazing companies for supporting us