I am having a cache issue. I have a project and worked on local. Now whenever i upload to server and edit the .env
and config/app.php
file. It is not taking the effect.
But, if i set the .env
configuartions of server in local and cleared the cache using php artisan config:cache
and upload it to server. It works. Should i always do this method?
So everytime i need change .env
i should first change it in local and clear the cache and upload in server? Or is there any method to directly command on server.
And again, in another project. Editing .env
and config/app.php
file directly in server takes immediate effect. What is happening?
php artisan config:cache This command clears the cached config file as mentioned above and recaches the latest configurations into a single file again.
Check APP_ENV in your .env file. If it's on production then yes, laravel caching it. You should run these commands before changing configs:
php artisan cache:clear php artisan config:clear php artisan route:clear
And then after changes run these:
php artisan config:cache php artisan route:cache php artisan optimize
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With