diff --git a/src/Lavary/Menu/Builder.php b/src/Lavary/Menu/Builder.php index f68a5b1..d1a9075 100644 --- a/src/Lavary/Menu/Builder.php +++ b/src/Lavary/Menu/Builder.php @@ -300,7 +300,13 @@ protected function prefix($uri) public static function formatGroupClass($new, $old) { if (isset($new['class']) and $new['class'] !== null) { - $classes = trim(trim(Arr::get($old, 'class')).' '.trim(Arr::get($new, 'class'))); + $oldClass = Arr::get($old, 'class'); + + if ($oldClass !== null) { + $oldClass = trim($oldClass); + } + + $classes = trim($oldClass.' '.trim(Arr::get($new, 'class'))); return implode(' ', array_unique(explode(' ', $classes))); }