-2

In some laravel the .env-file is heavily used to store the application configuration values. I am currently playing with a legacy project of mine and in a cronjob I am developing, I planned on testing out using .env to store information.

Question is: is there a "simple" way to use this .env file?

Trond
  • 363
  • 1
  • 4
  • 14

1 Answers1

0

Thanks to feedback from those who commented I ended up using the dotEnv package. This worked smoothly.

The package can be found here:

https://github.com/vlucas/phpdotenv

Here are some links related to using environment variables in PHP:

https://blog.doppler.com/configuring-php-applications-using-environment-variables https://www.twilio.com/blog/working-with-environment-variables-in-php https://mediatemple.net/community/products/grid/204643130/using-environment-variables-in-php

From the PHP manual

https://www.php.net/manual/en/function.getenv.php https://www.php.net/manual/en/function.putenv.php

Trond
  • 363
  • 1
  • 4
  • 14