Releases: datomatic/laravel-enum-collections
Releases · datomatic/laravel-enum-collections
v3.1.1
v3.1.0
v3.0.0
EnumCollection
now it's a one-dimensional collection that contains only enums.- New Unique options on model casting that prevent to have duplciates on
EnumCollection
EnumCollection
new methods:containsAny
,doesntContainAny
,toValues
,toCollectionValues
,mapStrict
,mapWithKeysStrict
EnumCollection
methods not supportedrange
,median
,mode
,crossJoin
,flip
,collapse
,collapseWithKeys
,pluck
,mergeRecursive
,select
,flatten
,replaceRecursive
,sliding
,dot
,undot
,zip
EnumCollection
methods that return a normal laravel collection:map
,keys
,mapWithKeys
,combine
,mapToDictionary
,groupBy
,split
,splitIn
,chunk
,chunkWhile
,countBy
,toBase
v2.0.3
v2.0.2
v2.0.1
- rename
whereEnumCollectionContains
towhereContains
- rename
whereEnumCollectionDoesntContain
towhereDoesntContain
- rename
orWhereEnumCollectionContains
toorWhereContains
- rename
orWhereEnumCollectionDoesntContain
toorWhereDoesntContain
- add field array cast compatibility with above methods
v2.0.0
Upgrade to v2 (please read UPGRADE.md file)
- add more elegant way to create an
EnumCollection
withtryFrom
andfrom
method
EnumCollection::of(Enum::class)->from($data);
EnumCollection::of(Enum::class)->tryFrom($data);
EnumCollection::from($data, Enum::class);
EnumCollection::tryFrom($data, Enum::class);
- change casting definition in only onle line inside
casts
model property
//Laravel 9/10
protected $casts = [
'field_name' => AsLaravelEnumCollection::class.':'.FieldEnum::class,
];
//Laravel 11
protected function casts(): array
{
return [
'field_name' => AsLaravelEnumCollection::of(FieldEnum::class),
];
}
- add Laravel 11 support
- refactoring