Q:

Sengrid getenv() functon inside queue (Laravel)

Hey I am using Sendgrid in my Laravel project.  I send mail from controller easily bu getting apikey like that : $sendgrid = new \SendGrid(getenv('SENDGRID_API_KEY'));
but when I call this function from laravel queue, this getenv returns null.. what is the problem? 

A:

In laravel's latest versions, I think env doesn't work like this anymore.  you should use \Config::get("file.value") in which file is the name of the config file in /configs folder,  value is the variable which resides in this filename.