How can i load a relation from a model in an Observer?
When i try to load the relation in the created method using $inport->load('items') it returns an empty array.
This is the relation defined in my Inport model:
public function items()
{
return $this->hasMany(InportItem::class);
}
Observer Method
public function created(Inport $inport)
{
dd($inport->load('items'));
}
Inport table
id
name
inport_items table
id
inport_id
number