How to use .env in custom controller

Hi @thitiphan

As said @lolafkok, you can’t use the env() function in a controller. It only works for configurations file :wink:
You have to use the process.env object in order to retrieve your environment variable which are in the .envfile

2 Likes