Open
Description
I have a problem in the following case and with eager loading:
two fields with the same type:
HasOne::make('metric')->type('inventory-metrics'),
HasOne::make('metric-service', 'metricService')->type('inventory-metrics'),
in model:
public function metric(): HasOne
{
return $this->hasOne(Metric::class, 'id', 'metric_id');
}
public function metricService(): HasOne
{
return $this->hasOne(Metric::class, 'id', 'metric_service_id');
}
in AppServiceProvider
I have Model::preventLazyLoading()
I include both relations in the query!
include=metric,metric-service
and throw an exception: Attempted to lazy load [metric] on model
Originally posted by @veneliniliev in #263 (comment)