Sometimes its necessary to disable the caching in Laravel. To do so a new cache-driver “none” must be added to the cache-configuration-file in config/cache.php
'stores' => [
//...
'none' => [
'driver' => 'null',
],
],
After that you have to set this cache-driver in your .env
-File and you Cache is disabled
Edit .env
and change the lineCACHE_DRIVER=file
toCACHE_DRIVER=none
Clearing some Caches in Laravel
Clear Application Cache:
php artisan cache:clear
Clear Route Cache
Throws an error if CACHE_DRIVER=none
php artisan route:clear
Clear Configuration Cache
Throws an error if CACHE_DRIVER=none
php artisan config:clear
Clear Compiled Views Cache
Throws an error if CACHE_DRIVER=none
php artisan view:clear
Cache store [none] is not defined.
To disable cache use:
CACHE_DRIVER=array
Same.