treeStoneIT / text-wrap

A Laravel Nova Wrapped Text field.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nova Text Field With Wrap Options

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: screenshot how it looks with regular text field

How it looks with text wrap field: screenshot 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

About

A Laravel Nova Wrapped Text field.


Languages

Language:PHP 53.2%Language:Vue 36.3%Language:JavaScript 9.9%Language:CSS 0.5%