jeudi 23 août 2018

Laravel - accessing .env variables

I tried to get the environment variable from the .env in my root with

Route::get('/test', function () {
    return "value is". getenv('APP_ENV');
});

and

Route::get('/test', function () {
    return "it is". env('APP_ENV');
});

It is in .env

APP_NAME=Laravel
APP_ENV=local

How can I get access to it?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire