lundi 11 juin 2018

Laravel 5.6 cannot access some .env variables

This frequently happens in my Laravel 5 app where sometimes .env variables cannot be read.

I have the following in my .env file:

STRIPE_SECRET=sk_test_mykey
STRIPE_KEY=pk_test_mykey

After clearing all the cache using all of these commands I still cannot access the STRIPE_SECRET variable:

php artisan config:clear
php artisan cache:clear
php artisan config:cache
composer dump-autoload

I have tried in my controller using env('STRIPE_SECRET') and have also tried in tinker:

enter image description here

Any one know why this happens?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire