Get environment value in controller

前端 未结 10 1605
既然无缘
既然无缘 2020-12-25 10:43

In my .env file I have the following:

IMAP_HOSTNAME_TEST=imap.gmail.com
IMAP_USERNAME_TEST=myemail@gmail.com
IMAP_PASSWORD_TEST=mypw

Now I

10条回答
  •  囚心锁ツ
    2020-12-25 11:21

    In config/app.php file make a instance of env variable like 'name' => env('APP_NAME', 'Laravel') & In your controller call it like config('app.name')

    Run following commands php artisan config:cache php artisan cache:clear if it is not working.

提交回复
热议问题