orchidsoftware / orchidsoftware/platform
Error with enum cast and select field
Open
@tabuna is already working on this.
Since Nov 10, 2025.
Errors
- Dominant language
- PHP
- Stars
- 4.8k
- Forks
- 663
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 7
Description
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:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.