diff --git a/src/Illuminate/View/ComponentAttributeBag.php b/src/Illuminate/View/ComponentAttributeBag.php index 0a5111037eb5..7a2b9f959ea6 100644 --- a/src/Illuminate/View/ComponentAttributeBag.php +++ b/src/Illuminate/View/ComponentAttributeBag.php @@ -56,6 +56,17 @@ public function get($key, $default = null) return $this->attributes[$key] ?? value($default); } + /** + * Determine if a given attribute exists in the attribute array. + * + * @param string $key + * @return bool + */ + public function has($key) + { + return array_key_exists($key, $this->attributes); + } + /** * Only include the given attribute from the attribute array. *