Hi @valeno12
You need to also specifiy the key from the relationship table so that the join operation that is performed by the Eloquent internally fetches the correct data.
Here is the revised code
$resultados = UaderArea::with('lugares:lugar,cod_lugar')
->get();
I hope this resolves your issue. Thanks
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community