DO NOT use the env() helper function in Laravel
Do not use the env() help function in your developments. Before telling you which one you should use, I will give you some reasons why not to use them and it is precisely due to the nature of the variables that it is referencing that they are environment variables that are found. stored in the .env of our project in Laravel therefore, due to its nature in which there are multiple of them defined in a single place and apart from the fact that we can easily change it by being able to use the env() function in their place in our developments in controllers and so on, this can cause some problems since they may not be defined in production or we may forget to define them.
So, it is better to instead use the help function called config() and define at the configuration level all those values that you want to use for your development, for example, PayPal keys, DropBox keys, anything that you want to integrate there.
- Andrés Cruz
Develop with Laravel, Django, Flask, CodeIgniter, HTML5, CSS3, MySQL, JavaScript, Vue, Android, iOS, Flutter