Commit e0a3cda2 authored by Jens Segers's avatar Jens Segers

Small tweak

parent 6ec9573b
...@@ -221,15 +221,10 @@ abstract class Model extends \Jenssegers\Eloquent\Model { ...@@ -221,15 +221,10 @@ 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);
if (array_key_exists($key, $attributes))
{ {
return $this->getAttributeValue($key); 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