diff --git a/src/model/relation/OneToOne.php b/src/model/relation/OneToOne.php index c45489ed..bc4b4a35 100644 --- a/src/model/relation/OneToOne.php +++ b/src/model/relation/OneToOne.php @@ -274,8 +274,8 @@ protected function match(string $model, string $relation, Model $result): void foreach ($result->getData() as $key => $val) { if (str_contains($key, '__')) { [$name, $attr] = explode('__', $key, 2); - if ($name == $relation) { - $list[$name][$attr] = $val; + if ($name === strtolower($relation)) { + $list[$relation][$attr] = $val; unset($result->$key); } }