treestoneit/text-wrap

This package is abandoned and no longer maintained. No replacement package was suggested.

A Laravel Nova Wrapped Text field.

v1.1.0 2018-08-31 16:33 UTC

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: 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