Skip to content

[9.x] Backed enum support for @js#45862

Merged
taylorotwell merged 2 commits intolaravel:9.xfrom
nuernbergerA:feature/backed-enum-support-for-js-directive
Jan 30, 2023
Merged

[9.x] Backed enum support for @js#45862
taylorotwell merged 2 commits intolaravel:9.xfrom
nuernbergerA:feature/backed-enum-support-for-js-directive

Conversation

@nuernbergerA
Copy link
Copy Markdown
Contributor

Current state of enum in @js

Given we have an defined enum:

enum Thing: string
{
    case SIMPLE = 'simple';
    //...
}

and pass it into @js

@js(Thing::SIMPLE)

Will output:

JSON.parse('\u0022simple\u0022')

After this PR

'simple'

@taylorotwell taylorotwell merged commit 4f98562 into laravel:9.x Jan 30, 2023
@nuernbergerA nuernbergerA deleted the feature/backed-enum-support-for-js-directive branch January 30, 2023 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants