1
I saw that I can use different connections for my models by defining as follows:
class Aparelho extends Model
{
protected $connection = 'minha_conexao';
protected $table = 'aparelhos';
}
But how can I define it dynamically? Like this: (Which doesn’t work)
class Aparelho extends Model
{
protected $connection = Auth::user()->conexao;
protected $table = 'aparelhos';
}