phptools-docs
phptools-docs copied to clipboard
Type of Eloquent model's morphOne relationship cant be inferred in HyperF
I am using HyperF and its ORM is based on Eloquent.
This is my model definition:
class CpsInstance extends AbstractProductInstance implements HourlyPostPaidProductInstance
{
public function instance()
{
return $this->morphOne(Instance::class, 'product_instance', 'product_class', 'id');
}
}
and access instance in service
$instance = $productInstance->instance;
it shows:
while other non-morphOne relationships are normal but are mixed type(is there a way to infer correctly in hyperf?)