{"repo":"emreyarligan/enum-concern","free":true,"listed":false,"github":"https://github.com/emreyarligan/enum-concern","clone":"git clone https://github.com/emreyarligan/enum-concern.git","description":"A PHP package for effortless Enumeration handling with Laravel Collections 📦 ✨","language":"PHP","stars":212,"topics":["concerns","enum","enumeration","laravel","package"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"EnumConcern - A PHP Package for Effortless Enumeration Handling 📦 ✨ EnumConcern is a PHP package designed to enhance the usage of PHP's Enum feature with a set of convenient methods. This package includes a Trait file that enables easy handling of Enums. Powered by Laravel Collections to make you feel at home. 🧡 Installation To install EnumConcern package, require it via composer: Now, you can use EnumConcern in your Enums. Methods Method Description Parameters Return Type ------------------------ ------------------------------------------------------------------------------------------------ -------------------------------------------------------- -------------- all Get all the values as a Collection. method = '' (optional) Collection allAsArray Get all the values as an array. method = '' (optional) array has Check if a specific value exists. value , method = '' (optional) bool caseExists Check if a specific case (key / name) exists. value , method = '' (optional) bool allCasesExists Check if all the given cases (keys / names) exist. cases , method = '' (optional) bool anyCaseExists Check if any of the given cases (keys / names) exist. cases , method = '' (optional) bool caseByValue Get the case (key / name) for a specific value. value , method = '' (optional) string toJson Convert all the values to a JSON string. method = '' (optional), jsonEncodeOption (optional) string toArray Convert all the values to an array. method = '' (optional) array toKeyValueCollection Convert ","default_branch":null,"files":null,"tree":[],"storefront":"/r/emreyarligan","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/emreyarligan/enum-concern/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}