Skip to content

Commit 3868446

Browse files
committed
Fix multiple level attributes using dot notation
1 parent a235700 commit 3868446

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/Jenssegers/Mongodb/Eloquent/Model.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -237,16 +237,7 @@ public function getAttribute($key)
237237
*/
238238
protected function getAttributeFromArray($key)
239239
{
240-
// Support keys in dot notation.
241-
if (str_contains($key, '.')) {
242-
$attributes = array_dot($this->attributes);
243-
244-
if (array_key_exists($key, $attributes)) {
245-
return $attributes[$key];
246-
}
247-
}
248-
249-
return parent::getAttributeFromArray($key);
240+
return array_get($this->attributes, $key);
250241
}
251242

252243
/**

0 commit comments

Comments
 (0)