I saw that I can use different connections for my models by defining them as follows:
class Aparelho extends Model
{
protected $connection = 'minha_conexao';
protected $table = 'aparelhos';
}
But how can I define this dynamically? Type this here: (That does not work)
class Aparelho extends Model
{
protected $connection = Auth::user()->conexao;
protected $table = 'aparelhos';
}