All notable changes to Enumhancer
will be documented in this file
- fixed serious bug in Getters where getting by integer would not match value first.
- added support for BIT_MODIFIER
- Support for Attributes
- Now supports Laravel 10
- dropped support for laravel 8
- Makers (make, tryMake etc.) are removed in favor of Getters
- added PHPStan support
- added IDE-helper (requires another package)
- added global class for configuring Enumhancer
- added global Macro support
- added asEnum to laravel's FormRequests
- tiny fix in isEnum validation: When Defaults are used, it should fail validation.
- added (basic) enum binding allowing you to bind basic enumerations to your routes and use Enumhancers secret sauce.
- Fixed a lot of potential issues with PHPstan.
- bugfix in Default where configured defaults would not override the by const defined value
- bugfix in Mappers where mapping to integers was not allowed
- You can now set Mapper FQCN in constants starting with
map
andmap_flip
- Mappers methods now are usable statically
- All Laravel rules have now macro's set on
Rule
- You can now use constants for Mappers and Defaults
- you can now flag a unit enum as
strict
, so you don't have to worry about casing in Values.
- Added Magic method functionality to State
- Added
to
andtryTo
methods toState
- Added
is
,isNot
,isIn
andisNotIn
to Comparison
- Added Flip, allowing to use a single mapper for mapping between enums
- From
now allows
UnitEnum
objects for use withFlip
- Comparison now allows different enums when used with Mappers
- Deprecated Makers, replaced by Getters
- Added Configure
- Added Dropdown
- Comparison now accepts null values
- Fixed bug in Casting where in the latest Laravel versions
the
Keep Enum Value Case
switch no longer worked.
- Added transition hooks State
- Makers & From now allow you to use integer keys on basic and string enums
- Added casting support for State
- Added State that allows you to have transitions with enums
- Added Defaults that allows you to have default enums
- Added Blade support
- Added Helper functions to ease usage of basic enums
- When using Comparison, you can now assert with
is
orisNot
- Added Eloquent Casting support for basic enumerations
- Added Extractor to extract enums from a string mentioned by value
- Some documentation repairs
- Added
cases
method toSubset
- Renamed Multi to Subset
- Added
names
method toSubset
- Added
values
method toSubset
- Added
do
method toSubset
- Added Multi. Currently allows you to compare against a subset of your enum
- Added Value (for use with basic enums)
- Added From. Useful for situations where you need them with basic enums
- Bugfix: Constructor did not use internal mapper
- You can now define a mapper in a method
- When you use an empty string or null in mappable, it will return null now
- Initial release