I have a Polymorphic Relationship between the Customer and Car Class.
Client Class:
public function carros()
{
return $this->morphMany(Carro::class, 'dono');
}
Car Class:
public function dono()
{
return $this->morphTo();
}
I am doing a search and in the result the Owner data appears as NULL
.
$result=Carro::with('dono')->where('id',10)->get();
Now if I do the search using Thinker
the values appear normally.
Where am I wrong to see NULL
as answer in DONO. The car values come back straight.