Is there a way to display the first 25 chars of a Laravel\Nova\Fields\Textarea on the index of a Resource?
We had the same problem and we solved it like this
Text::make('Text *', 'text')
->rules('required')
->hideFromIndex(),
Text::make('Text','text')
->displayUsing(function($id) {
$part = strip_tags(substr($id, 0, 25));
return $part . " ...";
})->onlyOnIndex(),
hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With