Skip to content

Laravel check if config has been cached

By Jasper Frumau

To check whether post deployment or post php artisan config:cache the configuration has been truly cached you can look up the cache in your application using

ll bootstrap/cache/
 total 516
 drwxrwxr-x 2 forge forge   4096 Mar  2 01:08 ./
 drwxrwxr-x 3 forge forge   4096 Mar  2 01:07 ../
 -rw-rw-r-- 1 forge forge     14 Mar  2 01:07 .gitignore
 -rw-rw-r-- 1 forge forge  45642 Mar  2 01:08 config.php
 -rwxrwxr-x 1 forge forge   3804 Mar  2 01:08 packages.php*
 -rw-rw-r-- 1 forge forge 441967 Mar  2 01:08 routes-v7.php
 -rwxrwxr-x 1 forge forge  17707 Mar  2 01:08 services.php*

Within bootstrap/cache you will see all your cached goodies including config.php . It contains all the cached configuration items you added to .env . So it is a rather long file.

You will also be able to read when they were created. Mine were created post deployment (UTC time on server) about half an hour before I wrote this. This confirms that php artisan config:cache had run its course. And this allowed my to rule out file caching based on config/cache.php interfering with our Redis caching..