plugin
plugin copied to clipboard
[Feature Request]: Enum's from(), cases(), tryFrom(), value property
Feature Description
I'm using PHP 8.1.
PHP's Enum Class has from()
, cases()
built-in method and ->value
property.
https://stitcher.io/blog/php-enums#serializing-backed-enums
/**
* @method static UserBioEnum from(mixed $input)
* @method static array cases()
* @property-read string value
*/
enum UserBioEnum: string
{
case BODY = 'BODY';
case HEIGHT = 'HEIGHT';
case RELIGION = 'RELIGION';
case MAKEUP = 'MAKEUP';
case DRINK = 'DRINK';
case PET = 'PET';
public static function in(): array
{
return Arr::map(array: UserBioEnum::cases(), callback: fn (UserBioEnum $enum) => $enum->value);
}
...
Is feature support available in laravel-idea?