Resolving the CozyUI Cached Configuration Error
Error Message:
Error: Laravel framework cache configuration detected. It interferes with how CozyUI tiered configuration works, please remove the cached configuration file and try loading CozyUI again.
This error means that the standard Laravel command php artisan config:cache has been run on this instance. While this is a common optimization for many Laravel projects, it is incompatible with CozyUI's architecture.
Understanding the Root Cause
What config:cache Normally Does: In a typical Laravel application, the php artisan config:cache command reads all configuration files and merges them into a single, optimized cache file (bootstrap/cache/config.php). This speeds up application loading.
Why It's a Problem for CozyUI: CozyUI is designed with a tiered configuration system. This system layers configuration in a specific order of priority:
- Runtime Environment Variables (highest priority)
- Settings from the Database (editable in the admin panel)
- Default Framework Files (
config/*.php) (lowest priority)
This tiered approach allows users to change settings from the CozyUI admin panel without needing to restart the application. When you run php artisan config:cache, you create a static "snapshot" of the configuration. This snapshot is created before CozyUI can load the dynamic settings from the database and would therefore interfere with our configuration.
How to Resolve the Error
To fix this, you need to remove the cached configuration file. This will allow CozyUI to revert to its intended behavior of loading configuration dynamically.
Solution 1: Manually Delete the Cached File
This is the most direct and reliable method. The cached configuration file is always stored at bootstrap/cache/config.php.
Delete bootstrap/cache/config.php from your CozyUI directory.
If you are using Docker, you must delete this file from inside your application container. First, find your container's name or ID with docker ps, then execute the command:
# Replace 'cozyui-app' with your actual container name or ID
docker exec cozyui-app rm /var/www/html/bootstrap/cache/config.phpAfter deleting the file, reload CozyUI. The error will be gone.
Solution 2 (Alternative): Use the the framework's helper Command
If you have shell access to your application environment, you can use the built-in Laravel command that is designed to perform this exact action.
- Run the command: From the root directory of your CozyUI project, execute:
php artisan config:clear- If you are using Docker, you must run the Artisan command inside the container:
# Replace 'cozyui-app' with your actual container name or ID
docker exec cozyui-app php artisan config:clearThis command finds and removes the bootstrap/cache/config.php file for you.