How to comment in laravel .env file?

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


Please note that as of Laravel 5.8 comment parsing in values has changed.

In Laravel 5.7 an .env file containing ENV_VALUE=foo#bar would evaluate to foo#bar.

In Laravel 5.8 the same .env file would evaluate to foo instead, with #bar being seen as a comment.

To use the # character in a value, double quote the entire value like so ENV_VALUE="foo#bar".