Add wrapping() method to Field class #5525
Answered
by
crynobone
phattarachai
asked this question in
Q&A
-
Hi, Currently, if I have a long message in a text field, I need to wrap it up inside the table cell using the following code: Text::make('messages')
->withMeta([
'wrapping' => true
]), While this approach works, it feels a bit cumbersome to me. I would prefer to have a simpler and more elegant way to achieve this, such as: Text::make('messages')
->wrapping(), I have searched the Nova documentation but could not find any information about wrapping text. Therefore, I am wondering if a similar method already exists or if this feature could be added to Nova. Thank you. |
Beta Was this translation helpful? Give feedback.
Answered by
crynobone
May 12, 2023
Replies: 1 comment
-
You can add macros to Field::macro('wrapping', function () {
// ....
return $this;
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
crynobone
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can add macros to
Field
.https://tighten.com/insights/the-magic-of-laravel-macros/