### Install package with Composer Source: https://github.com/roundly-consulting/enums-for-laravel/blob/main/README.md Requires PHP 8.4 and Laravel 12 or 13. Run this command in your project root to install the package. ```bash composer require roundly-consulting/enums-for-laravel ``` -------------------------------- ### Add Helpers trait to an enum Source: https://github.com/roundly-consulting/enums-for-laravel/blob/main/README.md Use the Helpers trait in any enum to gain access to helper methods. This example defines a backed enum with string cases. ```php use RoundlyConsulting\Enums\Helpers; enum NewsCategory: string { use Helpers; case HotNews = 'hot-news'; case RegularNews = 'regular-news'; case PrivateNews = 'private-news'; } ``` -------------------------------- ### Use enum helper methods Source: https://github.com/roundly-consulting/enums-for-laravel/blob/main/README.md Demonstrates label(), values(), toArray(), options(), validationRule(), fromLabel(), tryFromName(), and isIn() methods. Labels are translated through lang/*.json files. ```php NewsCategory::HotNews->label(); // "Hot News", translated through lang/*.json NewsCategory::values()->all(); // ['hot-news', 'regular-news', 'private-news'] NewsCategory::toArray(); // ['hot-news' => 'Hot News', …] for a