Repository navigation
Allow Blade to render enums #44440
|
Follow up of #44431. Echoing a enum in Blade causes an exception. I was thinking it might be a nice feature to echo either its name or its value according to the type of enum. return view('my-view', [
'enum' => MyEnum::myValue,
]);// view
{{ $enum }} |
Answered by
nunomaduro
Oct 3, 2022
Replies: 3 comments 2 replies
|
my package can do that for you in the meantime: https://github.com/henzeb/enumhancer |
0 replies
|
Thank you - I will take a look if is possible to fix this. |
1 reply
Answer selected by
brunoalod
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you - I will take a look if is possible to fix this.