public function hasAttribute($key, $subKey = null) { if (is_null($subKey)) { return Arr::has($this->attributes, $key); } return Arr::has($this->attributes, "{$key}.{$subKey}"); }