laravel-enum
laravel-enum copied to clipboard
Simple, extensible and powerful enumeration implementation for Laravel.
Get the value using the value of description would be more awesome one 👍
How about making Enum a dynamic path?
@spawnia Hi, I want to talk about this change https://github.com/BenSampo/laravel-enum/commit/5094099a9ab9b710f6c262402598501886432699#diff-ee71af26064ea012953831df497c2297ea91606aa26bb133e73dc1b51deec2ccR603 which was discussed here https://github.com/BenSampo/laravel-enum/issues/244 I think this change must be documented, at leat, as it breaks the behavior explained...
- [x] Added or updated tests - [x] Added or updated the [README.md](../README.md) - [x] Detailed changes in the [CHANGELOG.md](../CHANGELOG.md) unreleased section **Related Issue/Intent** This pull request improves type safety...
I'm using the `QueriesFlaggedEnums` trait in the `Badge` model. I've defined a local scope which use the `hasAnyFlags()`. PHPstan raises an error like: ``` ------ ---------------------------------------------------------------------------------- Line app/Models/Badge.php ------ ----------------------------------------------------------------------------------...
Calling translations on boot method on [EnumServiceProvider](https://github.com/BenSampo/laravel-enum/blob/master/src/EnumServiceProvider.php#L58) cause the invocation of loadJsonPaths function of [Translation FileLoader](https://github.com/laravel/framework/blob/9.x/src/Illuminate/Translation/FileLoader.php#L137). This blocks the normal load of the others packages translation files. I think the...
Resolves #259
Whenever a translation is used in the [service provider](https://github.com/BenSampo/laravel-enum/blob/master/src/EnumServiceProvider.php#L60), an app that loads translations from the DB (e.g. using [spatie/laravel-translation-loader](https://github.com/spatie/laravel-translation-loader)) will break, cause the database hasn't been migrated yet when...
Hy, I have a Form Request with a custom validation rule: `$rules = [ 'input.value' => ['required', new EnumValue(ValueEnum::class, false)], ];` Validation works fine but the message received is ambiguous:...
QueriesFlaggedEnum got some typehints added, in the previous versions `Model::hasFlag('myenum', MyEnum::MyCase())` worked, but now it only accepts it like this: `Model::hasFlag('myenum', MyEnum::MyCase()->value)`. Possible solution would be to allow `int|FlaggedEnum` as...