Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config values not loaded after a config:cache command #15

Open
Okipa opened this issue May 21, 2019 · 1 comment
Open

Config values not loaded after a config:cache command #15

Okipa opened this issue May 21, 2019 · 1 comment

Comments

@Okipa
Copy link
Contributor

Okipa commented May 21, 2019

The config values are not loaded after a config:cache command.
The values are read the wrong way here : https://github.com/Edujugon/laradoo/blob/master/src/Odoo.php#L723.
They should be read this way, in order to get the cached values when the command above is executed : config('laradoo.db').

@Okipa
Copy link
Contributor Author

Okipa commented May 21, 2019

I managed to load these values with the following workaround but the package should definitely be able to read cached config values :

// method declared in a OdooService for example.
// then, call your service method (new OdooService)->connect() instead of the (new Odoo)->connect() method.
/**
     * Connect to odoo api.
     *
     * @return \Edujugon\Laradoo\Odoo
     * @throws \Edujugon\Laradoo\Exceptions\OdooException
     */
    public function connect(): Odoo
    {
        return (new Odoo)
            ->host(config('laradoo.host'))
            ->db(config('laradoo.db'))
            ->username(config('laradoo.username'))
            ->password(config('laradoo.password'))
            ->connect();
    }```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant