Of a question, I was given a way to query with child objects using the Join of eloquent, The query is below:
$dados = Roda::join('veiculos', function($query) {
$query->on('veiculos.id', '=', 'rodas.veiculo_id');
$query->where('veiculo.cor', '=', 'vermelho');
})
->get();
But now I need to hide fields that come in the object, and I do not know how to do this using the Join model that is seen above, the code solves another problem, which I can not solve otherwise. Now I need to hide fields, how can I do it?