Skip to content

Releases: datomatic/laravel-enum-collections

v3.1.1

03 Nov 09:38
Compare
Choose a tag to compare
  • laravel-enum-helper v2

v3.1.0

02 Nov 13:02
Compare
Choose a tag to compare
  • whereContainsAny, orWhereContainsAny, whereDoesntContainAny and orWhereDoesntContainAny scopes on HasEnumCollections trait

v3.0.0

02 Nov 12:20
Compare
Choose a tag to compare
  • 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 supported range, 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

03 Oct 18:16
Compare
Choose a tag to compare
  • fix phpDoc
  • type refactor

v2.0.2

10 Apr 15:46
f2cbfe6
Compare
Choose a tag to compare
  • fix: adding forwarding unhandled __call/__callStatic to EnumCollection parent

v2.0.1

14 Mar 16:36
Compare
Choose a tag to compare
  • rename whereEnumCollectionContains to whereContains
  • rename whereEnumCollectionDoesntContain to whereDoesntContain
  • rename orWhereEnumCollectionContains to orWhereContains
  • rename orWhereEnumCollectionDoesntContain to orWhereDoesntContain
  • add field array cast compatibility with above methods

v2.0.0

14 Mar 15:00
fbfc944
Compare
Choose a tag to compare

Upgrade to v2 (please read UPGRADE.md file)

  • add more elegant way to create an EnumCollection with tryFrom and from 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

v1.1.1

04 Jan 16:47
Compare
Choose a tag to compare
  • remove phpdoc on EnumCollections

v1.1.0

29 Jul 11:29
Compare
Choose a tag to compare
  • add whereEnumCollectionDoesntContain and orWhereEnumCollectionDoesntContain method on trait
  • accept on all where methods array and collection

v1.0.2

15 Feb 15:29
645d951
Compare
Choose a tag to compare

Laravel 10 support