Skip to content

Support array of enum #60

Description

@lokken

For instance, in User model

    protected $casts = [
        'database_roles' => AsEnumCollection::class.':'.DatabaseRole::class,
    ]

Here is the error when running the model:typer tool.
Class "Illuminate\Database\Eloquent\Casts\AsEnumCollection:App\Enums\DatabaseRole" does not exist

It's a simple workaround to remove the AsEnumCollection temporarily, generate the types, and then add [] to the end of the generated type, but thought you may want to support this use case. Thanks, have a good one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    StalebugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions