You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Strongly typed enum implementation for Laravel. Based on [eloquent/enumeration](https://github.com/eloquent/enumeration) and inspired by [bensampo/laravel-enum](https://github.com/bensampo/laravel-enum)
9
+
Enum implementation for Laravel. Based on [eloquent/enumeration](https://github.com/eloquent/enumeration) and inspired by [bensampo/laravel-enum](https://github.com/bensampo/laravel-enum)
10
10
11
11
## Features
12
12
13
-
* Strongly typed
14
13
* Key/value-definition via class constants
15
14
* Full featured suite of methods
16
15
* Enum artisan generator
17
16
* Validation rules for passing enum values as input parameters
18
17
* Localization support
19
-
*Extendible
18
+
*Extensible
20
19
21
20
## Table of Contents
22
21
@@ -41,10 +40,12 @@ Strongly typed enum implementation for Laravel. Based on [eloquent/enumeration](
41
40
Via Composer
42
41
43
42
```bash
43
+
44
44
$ composer require sourceboat/laravel-enumeration
45
45
```
46
46
47
47
If you're using Laravel < 5.5 you'll need to add the service provider to `config/app.php`
You may validate that a value passed to a controller is a valid value for a given enum by using the `EnumerationValue` rule, for easier handling there are helper methods for creating the rule: `Enumeration::makeRule()`, `Enumeration::makeRuleWithWhitelist($whitelist)` and `Enumeration::makeRuleWithBlacklist($blacklist)`.
194
198
195
199
```php
@@ -330,8 +334,3 @@ Much of the functionality in this Package is inspired by [bensampo/laravel-enum]
330
334
-[laravel/framework](https://github.com/laravel/framework) is licensed under MIT
331
335
332
336
This package is also licensed under the MIT license.
333
-
334
-
## TODOs
335
-
336
-
*[x] Tests for all enumeration-functions and the rule.
337
-
*[x] Model-Trait to enable casting of enumerations and "on the fly"-validation for enumeration values on models.
0 commit comments