Commit e0a3cda2 authored by Jens Segers's avatar Jens Segers

Small tweak

parent 6ec9573b
...@@ -221,14 +221,9 @@ abstract class Model extends \Jenssegers\Eloquent\Model { ...@@ -221,14 +221,9 @@ abstract class Model extends \Jenssegers\Eloquent\Model {
public function getAttribute($key) public function getAttribute($key)
{ {
// Check if the key is an array dot notation. // Check if the key is an array dot notation.
if (str_contains($key, '.')) if (str_contains($key, '.') and array_has($this->attributes, $key))
{ {
$attributes = array_dot($this->attributes); return $this->getAttributeValue($key);
if (array_key_exists($key, $attributes))
{
return $this->getAttributeValue($key);
}
} }
$camelKey = camel_case($key); $camelKey = camel_case($key);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment