{"repo":"cerbero90/laravel-enum","free":true,"listed":false,"github":"https://github.com/cerbero90/laravel-enum","clone":"git clone https://github.com/cerbero90/laravel-enum.git","description":"🎲 Laravel package to supercharge enum functionalities.","language":"PHP","stars":189,"topics":["enum","enumeration","laravel"],"license":"MIT","category":"dev-tools","readme_excerpt":"🎲 Laravel Enum [![Author][ico-author]][link-author] [![PHP Version][ico-php]][link-php] [![Laravel Version][ico-laravel]][link-laravel] [![Latest Version][ico-version]][link-packagist] [![Software License][ico-license]](LICENSE.md) [![Build Status][ico-actions]][link-actions] [![Code Quality][ico-code-quality]][link-code-quality] [![Coverage][ico-coverage]][link-coverage] [![PHPStan Level][ico-phpstan]][link-phpstan] [![Total Downloads][ico-downloads]][link-downloads] Laravel package to supercharge enum functionalities. [!TIP] Need a framework-agnostic solution? Consider using 🎲 Enum instead. 📦 Install Via Composer: 🔮 Usage 🏷️ Meta 🧺 Cases collection 🪄 Magic translation 💊 Encapsulation 🗄️ Cache 🔓 Session 🦾 Artisan commands 🗒️ enum:annotate 🏗️ enum:make 💙 enum:ts This package provides all the functionalities of 🎲 Enum plus Laravel-specific features. To supercharge our enums, we just need to let them use the Enumerates trait: 🏷️ Meta Laravel Enum extends Enum's meta by allowing us to attach meta with a class name. This class is resolved by the Laravel container when invoking the corresponding meta method: In the enum above, each case specifies a handler meta with a class name. When a case calls its handler() meta method, the corresponding class is resolved through the IoC container: If we need to resolve a default class for most cases, we can attach the meta to the enum itself. Cases with their own meta override the default class: In the example above, all cases","default_branch":null,"files":null,"tree":[],"storefront":"/r/cerbero90","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/cerbero90/laravel-enum/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."}