diff --git a/changelog.md b/changelog.md index 3b0a473..5e7e924 100644 --- a/changelog.md +++ b/changelog.md @@ -30,4 +30,9 @@ All notable changes to `Enum` will be documented in this file. ## Version 0.1.1 ### Fixed - - fixed performances issue on toValues and toLabels \ No newline at end of file + - fixed performances issue on toValues and toLabels + +## Version 0.1.2 + +### Changed + - changed toJson to output array with label and value diff --git a/src/BaseEnum.php b/src/BaseEnum.php index 617c8d1..769e9d2 100644 --- a/src/BaseEnum.php +++ b/src/BaseEnum.php @@ -267,7 +267,10 @@ abstract class BaseEnum implements JsonSerializable, UrlRoutable */ public function jsonSerialize() { - return $this->value; + return [ + 'value' => $this->value, + 'label' => $this->label + ]; } public function __toString(): string