Skip to content

Error with enum cast and select field #3060

Description

@keasy9

If model field casted as enum class, e.g.:

protected $casts = [
    'user_type' => UserTypeEnum::class,
];

and select field is used to edit it:

Select::make('user_type')->options(
    collect(UserTypeEnum::cases())
        ->mapWithKeys(fn($case) => [$case->value => $case->title()])
),

fatal php error is appearing:
Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions