I have created class inside of app folder. I'm using lumen 5.5, I have declared variable in .env file as like
MSG91_KEY=7214AyBG34545K56ff4bcb
MSG91_SENDER_ID=LOGIMX
MSG91_ROUTE=4
I have tried to access this on my custom class like below, but say not defined
private $API_KEY = env("MSG91_KEY");
Is there any other restriction using env variables in the custom class.