At the deployment destinationphp artisan config: cacheBecause I did, the one that had no error until now became 500 error. So oncephp artisan key: generateRecreate the application key withphp artisan config: clearI did, but I still get an error. I'm wondering if I can't get the .env file, but what should I do in that case?

Thank you.

Laravel 6.x

  • Answer # 1

    Running php artisan config: clear caches the config file and prevents the .env file from being read.

    Is there any place that directly uses env () other than the configuration file (file under the config directory)?
    If there is such a part, .env will not be loaded and null will be returned.

    What to do in this case is

    Add the value you want to add to .env to config

    Use config () instead of env () to get the value

    I think the above correction can be used.

    Settings cache