diff --git a/src/Support/Traits/EnumEnhance.php b/src/Support/Traits/EnumEnhance.php index 30e63c7..b3fd524 100644 --- a/src/Support/Traits/EnumEnhance.php +++ b/src/Support/Traits/EnumEnhance.php @@ -28,7 +28,8 @@ public function value(): int|string public function description(string $localizationGroup = 'enums'): string { - $key = "$localizationGroup.".static::class.'.'.$this->name; + $name = (version_compare(app()->version(), '11.0.0', '>=') ? $this->value : $this->name); + $key = sprintf("%s.%s.%s", $localizationGroup, static::class, $name); return Lang::has($key) ? Lang::get($key) : Str::of($this->name)->replace('_', ' ')->lower(); }