How to comment in laravel .env file?

Akshay Khale picture Akshay Khale · Sep 3, 2015 · Viewed 83.7k times · Source

I am working on a project in Laravel where I am storing some settings in .env file setting like few parameters for testing purpose and few parameters are for live working so I was just checking that is there any way to comment in .env file of Laravel.

Here is an example

/* Test Settings */
ACCESS_KEY=qwsdr
ACCESS_TOKEN=Bgcvfsx

/* Live Settings */
ACCESS_KEY=985AsdefG
ACCCESS_TOKEN=LFP994kL

Answer

Joel Hinz picture Joel Hinz · Sep 3, 2015

You use hash commenting:

# Test Settings
ACCESS_KEY=qwsdr
ACCESS_TOKEN=Bgcvfsx

# Live Settings
ACCESS_KEY=985AsdefG
ACCCESS_TOKEN=LFP994kL

Documentation: https://github.com/vlucas/phpdotenv#comments