I want to store user configuration data on database and I\'m following this forum thread about it http://forumsarchive.laravel.io/viewtopic.php?id=10406 but when I implemented i
Working with models in your settings files is not the best way to use them.
Your problem is, that your model query started BEFORE Laravel started it's services. That's why, when you try to make your query, model can't resolve it's connection, because DB service hasn't been initiated.
If you want do this stuff, create your own ServiceProvider and update your config there, or do it right in the boot
method of your existing AppServiceProvider
.