reedware/nova-textwrap-field

Adds a text field with wrapping capabilities to Laravel Nova.

Maintainers

Package info

github.com/tylernathanreed/nova-textwrap-field

Language:Vue

pkg:composer/reedware/nova-textwrap-field

Statistics

Installs: 2 724

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2019-10-31 15:40 UTC

This package is auto-updated.

Last update: 2026-03-07 23:58:46 UTC


README

Latest Version on Packagist Total Downloads

Installation

You can install the package in to a Laravel app that uses Nova via composer:

composer require reedware/nova-textwrap-field

Usage

Create a new field like you would any other field:

<?php

namespace App\Nova;

use Reedware\NovaTextwrapField\TextWrap;

class MyResource extends TextFilter
{
    /**
     * Get the fields displayed by the resource.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function fields(Request $request, $query, $value)
    {
        return [
            TextWrap::make('My Field', my_field')
        ];
    }
}

Options

The TextWrap field extends the default TextArea field, so any options typically available on TextArea are also availble on TextWrap. Additionally, the TextWrap field is configured to show on the Index page by default (whereas TextArea does not).

There are two additional options:

  • Markdown: TextWrap::make(...)->asMarkdown() will parse and display the contents are markdown
  • Max Width: TextWrap::make(...)->withMeta('maxWidth' => '...') will enforce a maximum width on the field content

Apperance

Here's an example of how I've used this in the wild:

Example