Hello @valen
The cache commando's are only for production because they cache the configuration.
As example, config:cache will cache your config files and if the config is cached your .env file will not be loaded.
Quote from the documentation:
If you execute the config:cache command during your deployment process, you should be sure that you are only calling the env function from within your configuration files. Once the configuration has been cached, the .env file will not be loaded and all calls to the env function for .env variables will return null.
php artisan optimize
cache multiple part, see the documentation: https://laravel.com/docs/11.x/deployment#optimization
My advice is to run php artisan optimize:clear
on your machine to remove all the cached parts and not run any cache command during development. During the deployment I advice to run php artisan optimize
if everything is correctly configured.
ps. I have updated your post to make your commands readable :)
curioushack liked this reply
FYI, the flooring video from LaravelDaily explains why you may want to move the variables out of the env file. This would also potentially resolve the issue you are encountering.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community