I have a two page app.
- Landing page as no queries.
- Second page has a single query using a very basic eloquent model:
$claim = Claims::where('username', $username)->first();
On the second page, I receive SQLSTATE[HY000] [2002] Connection refused
I know typically this is an issue with the DB credentials in the .env, so I've changed them to match another project that works locally (both apps on a very basic Docker image).
When I run php artisan config:cache I get:
file_put_contents(storage/framework/sessions/pKiOoJAXNAp2xe6scQOiaH8RU70iZcbgJvU6RmFl): Failed to open stream: No such file or directory
If I run php artisan config:clear I get SQLSTATE[HY000] [2002] Connection refused
Can someone help explain why those are causing to vastly different errors? (I've run both commands from inside and outside of the Docker container and the behavior is reproducible).