Laravel Enum Package

Laravel Enum is a package by Ben Sampson that adds support for creating enums in PHP and includes a generator for Laravel. Heres an example of what an Enum class looks like using this package: Check out the readme for a list of methods and other examples of how to use this package. One of my favorite features I noticed from the readme is controller validation using a supplied EnumValue rule: You can also validate on the keys using the EnumKey rule: Another Laravel-specific feature that you might find useful is localization:

Read Full Article at

Tags: , , , , , , , , , ,