treestoneit / text-wrap
A Laravel Nova Wrapped Text field.
Installs: 53 447
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=7.1.0
This package is auto-updated.
Last update: 2019-10-07 01:41:41 UTC
README
Since Nova now includes asHtml()
Meta on the Text field (as of v1.0.9), there is no more need for this package as same functionality can be achieved with core Text field.
The default text field in nova doesn't wrap, this causes table to become very wide. By using this field you can either wrap after set number of characters or by splitting the text by a specified marker.
Screenshots
How it looks with regular text field:
How it looks with text wrap field:
Installation
Install the package into a Laravel app that uses Nova with Composer:
composer require treestoneit/text-wrap
Usage
Add the field to your resource in the fields
method:
use Treestoneit\TextWrap\TextWrap; ... ... TextWrap::make('Product Name')->wrapMethod('length',40),
If you would like to use the wrap through spliting the text by marker, here is an example:
use Treestoneit\TextWrap\TextWrap; ... ... TextWrap::make('Product Name')->wrapMethod('explode','-*-'),
Please note: Only Index version of the field is configured to wrap