From c9e012e38763f11ef1ac65bc9b3eeb31d07bd516 Mon Sep 17 00:00:00 2001 From: Yoga Pangestu Date: Fri, 24 Oct 2025 08:29:22 +0700 Subject: [PATCH] feat(trait): add WithComment and Withvalue for enum utils --- app/Traits/Enum/WithComment.php | 11 +++++++++++ app/Traits/Enum/WithValue.php | 11 +++++++++++ 2 files changed, 22 insertions(+) create mode 100644 app/Traits/Enum/WithComment.php create mode 100644 app/Traits/Enum/WithValue.php diff --git a/app/Traits/Enum/WithComment.php b/app/Traits/Enum/WithComment.php new file mode 100644 index 0000000..d4bf58a --- /dev/null +++ b/app/Traits/Enum/WithComment.php @@ -0,0 +1,11 @@ + "{$case->value}: {$case->label()}", self::cases())); + } +} diff --git a/app/Traits/Enum/WithValue.php b/app/Traits/Enum/WithValue.php new file mode 100644 index 0000000..47d3487 --- /dev/null +++ b/app/Traits/Enum/WithValue.php @@ -0,0 +1,11 @@ + $case->value, self::cases()); + } +}