Skip to content
Advertisement

Laravel does not read .env variables when there is a # character

In Laravel 7 when I do a simple:

JavaScript

the output is always:

JavaScript

And my .env file is:

JavaScript

I am waiting for a response : “Secret: 123#456#789”. And don’t understand why I receive only “Secret: 123”.

I know it is a trivial question, but I am on this problem…

Thanks

Advertisement

Answer

# is used to declare a comment in the .env file. Wrap the var’s value in quotes.

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement