0

I am debugging env vars with Laravel 8 in production.

In local, I have no problem.

In production, when I do:

dd(env('DB_CONNECTION'),

I get null, but my app works, which means it is connecting to the DB.

Why isn't it working ?

I tried to clear all caches with php artisan optimize, with no success.

Any idea ?

Juliatzin
  • 18,455
  • 40
  • 166
  • 325
  • 2
    Access it through the cache instead. Env variables are not accessible when they have been cached. – Qirel Oct 01 '20 at 08:15
  • 1
    See the note in the documentation, https://laravel.com/docs/8.x/configuration#configuration-caching – Qirel Oct 01 '20 at 08:17

0 Answers0