This time I have a mental gap and I do not know what is escaping me ....
I have the following collection, annex image:
I have a model called Income and another called DetailInside, in which in the relations I have Income to Detail Income and vice versa "An income have many details of income and many details of income belong to an income" in my model the relationship is so:
from income to income detail the relationship is called: detalleIngreso
detail of income to income the relationship is called: income
Well everything is fine there, the issue is that I'm doing an eloquent query to income and I do it like this:
$verDatosIngreso=Ingreso::orderBy('id')
->with('detalleIngreso')
->where('id','=',$id)
->get();
it is assumed afterwards that in order to access "service_id" of the detail-relationship relationship, I must go through the array
foreach($verDatosIngreso as $c)
{
$c->detalleIngreso->servicio_id
}
But I'm not working, I know I'm missing something but I do not remember what the hell it is.
I hope you can clarify the hazing that I am committing the truth I do not remember.
Thank you ...