Dotenv is a convenience for development, not intended for deployment along with your app. You would set real environment variables on your production server
Is there any usefull official documentation (with proper explanation) about the .env parameters?
I cant find a comprehensive enough manual/tutorial/documentation about the config-file. Lacking this most crucial information concerning this particular php framework is like driving a car without any knowledge about the dashboard layout and all its particular indicators and switches. Imho totally NOT DONE when distributing software to a large usergroup like this or to any usergroup at all for that matter.
When developing to eventually migrate to a production server one absolutely needs to know everything about the different configuration parameters. This knowledge concerns a most crucial part of this software. I really expected this to be documented. However the page on https://laravel.com/docs/5.6/configuration#introduction isnt cutting it at all.
The sentence 'dont use/not using .env for your production environment' comes along quite a few times over here but with no specific/detailed explanations. I wonder why actually as Laravel newcomers like myself find themselve's totally in the dark with such answers. Do you also dont know while providing the answer still? Well I just figured it out, after a very extensive (perhaps unnecessary?) hours long search and apache-testsession....
Instead of hardcoding the environment variables in any of the files related to the Laravel installation one would/should use the server's "virtualhost" directive.
Example, for knowledge sharing and practice sake:
I'm using the xampp Apache server (package) as my development server. Apache's virtualhost's directive is located at the path = xampp\apache\conf\extra\httpd-vhosts.conf
I deleted the following environment vars from .env:
DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=laraveldb DB_USERNAME=root DB_PASSWORD=
Then I did set the parameters in httpd-vhosts.conf up like so and restarted the server via the xampp control panel:
<VirtualHost *:80>
SetEnv DB_HOST 127.0.0.1
SetEnv DB_PORT 3306
SetEnv DB_DATABASE laraveldb
SetEnv DB_USERNAME root
SetEnv DB_PASSWORD
</VirtualHost>
Now Laravel gets the environment variables via php->getenv ( http://php.net/manual/en/function.getenv.php ) but I guess xampp sets getenv up by default as it worked instant.
Please or to participate in this conversation.