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

Credenciais pelo Modelo #122

Open
marcelphilippe opened this issue Sep 27, 2019 · 2 comments
Open

Credenciais pelo Modelo #122

marcelphilippe opened this issue Sep 27, 2019 · 2 comments

Comments

@marcelphilippe
Copy link

Existe alguma forma de setar as credenciais direto pelo modelo? Utilizo multi tenant e preciso puxar diretamente do banco de dados os dados de autenticação.

@brunobacha
Copy link

Tenho interesse nisso. Alguém conseguiu um exemplo?

@ojulianos
Copy link

Eu fiz usando a o config do próprio laravel, quando carrega os dados do tenant muda a config

`use Illuminate\Support\Facades\Config;

public function __construct()
{
$this->middleware(function ($request, $next) {

            $configuracao = $this->cliente->configuracao;

            Config::set('pagseguro.sandbox', $configuracao->pagseguro_sandbox);
            Config::set('pagseguro.email', $configuracao->pagseguro_email);
            Config::set('pagseguro.token', $configuracao->pagseguro_token);
            Config::set('pagseguro.notificationURL', $configuracao->pagseguro_prefixo);

        return $next($request);
    });
}`

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

3 participants