O
O
OlegSedoy2021-06-07 04:39:26
Laravel
OlegSedoy, 2021-06-07 04:39:26

New service provider won't let you install LARAVEL?

There is a service provider SettingsServiceProvider

class SettingsServiceProvider extends ServiceProvider
{
    public function register()
    {
        //
    }

    public function boot(Factory $cache, Setting $settings)
    {
        $settings = $cache->remember('settings', 60, function() use ($settings)
        {
            return $settings->pluck('value', 'key')->all();
        });

        config()->set('settings', $settings);
    }
}


When installing copmoser on the server,
SQLSTATE[HY000] [2002] Connection refused (SQL: select `value`, `key` from `settings`) swears,

I understand that it requires a database, but I can’t do migrations for the same reason. You can comment out the provider and make migrations, but this is not convenient.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
JhaoDa, 2021-06-07
@OlegSedoy

https://laravel.com/docs/8.x/providers#deferred-pr...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question