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 }}
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
my package can do that for you in the meantime: https://github.com/henzeb/enumhancer |
Beta Was this translation helpful? Give feedback.
-
Thank you - I will take a look if is possible to fix this. |
Beta Was this translation helpful? Give feedback.
-
Read other discussions |
Beta Was this translation helpful? Give feedback.
Thank you - I will take a look if is possible to fix this.