Hi guys
I'm trying to replace the env variable dynamic settings from AppServiceProvider
But I'm getting this error on Github workflows,
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Illuminate\Database\QueryException
SQLSTATE[HY000] [2002] Connection refused (SQL: select `name`, `payload` from `settings` where `group` = mail)
How can I solved it, thanks guys
Hello @datlechin I think that you load the data from the database (I can't see the code behind the settings classes) and that means it is needed to have a database with the settings in your Github workflow.
Because the composer scripts also execute an artisan command you need to have the database setup before any composer install.
Personally I shouldn't load this in a service provider. That means it is executed on every request/command/scheduled task. You can create a server that configure the settings before it is needed. (like loading and configure the mail settings before sending mail)
Another question is: does it really change so much that you can't use the .env for this config? It looks a lot more complicated.
ps. Can you post the code next time in the post and not an image?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community