BenSampo / laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.
https://sampo.co.uk/blog/using-enums-in-laravel
MIT License
1.99k stars 163 forks source link

add extra attributes #314

Closed e-rasekh closed 1 year ago

e-rasekh commented 1 year ago

Hi, I could't add extra attribute to enums. I add an 'IsFinal' class, to attributes folder, such as 'description' class. and add two method getAttributeDescription and getDescription, for isFinal. but below code returns null for "isFinal': $descriptionAttributes = $constReflection->getAttributes(IsFinal::class); dd($descriptionAttributes); while for description returns enum reflectionclass constant. I really need to add some attributes to some enums. is there any way ?

spawnia commented 1 year ago

I don't fully understand what you are asking, but it does not seem like a problem that can be solved in this library. It seems like you are just struggling with correct usage of PHP attributes and reflection, and this issue tracker is not a help forum.

e-rasekh commented 1 year ago

thanks, sorry, I just need to add some extra properties to enum. there is description, but I want add 'color', 'isfinalstatus' , and etc. where can ask my question ?

I ask my question on stackoverflow too.