feat: add support for AsEnumCollection casts (#1557)

* Adding support for casting to AsEnumCollection

* Adding missing string to advanced_casts table for enum_collection

* Added to snapshots and ArrayCastsWithComment

* Update CHANGELOG.md

* Reverted automated whitespace, strict changes

* Updated test snapshots, tests passing

* Whitespace revert

---------

Co-authored-by: Barry vd. Heuvel <[email protected]>
This commit is contained in:
Braunson Yager
2024-07-12 16:03:57 +02:00
committed by GitHub
co-authored by Barry vd. Heuvel
parent 67c00c0978
commit 672acce5ae
7 changed files with 14 additions and 3 deletions
@@ -6,6 +6,7 @@ namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\AdvancedCasts\Mo
use Illuminate\Database\Eloquent\Casts\AsArrayObject;
use Illuminate\Database\Eloquent\Casts\AsCollection;
use Illuminate\Database\Eloquent\Casts\AsEnumCollection;
use Illuminate\Database\Eloquent\Model;
class AdvancedCast extends Model
@@ -24,6 +25,7 @@ class AdvancedCast extends Model
'cast_to_encrypted_json' => 'encrypted:json',
'cast_to_encrypted_object' => 'encrypted:object',
'cast_to_as_collection' => AsCollection::class,
'cast_to_as_enum_collection' => AsEnumCollection::class,
'cast_to_as_array_object' => AsArrayObject::class,
];
}