Laravel Community Tools by Tighten
Laravel Nova icon Nova Packages
T

Textarea with character count

This package is possibly abandoned. Please proceed with care.

Readme

Laravel Nova Enhanced Textarea Field

A custom Textarea Field for Nova with character count

Stable Version License PHP Version Require

Note this feature has been added to Nova's own TextArea component starting with Nova 4.16.0. Please make use of the built-in feature over this package.

Features

  • For Laravel Nova ^4.0
  • Character count and maxLength warning

Installation

composer require ardenthq/nova-enhanced-textarea

Use

  1. Add the EnhancedTextarea field to your Nova Resource.

  2. Call the ->maxLength() method to define the max number of characters that the field should show.

<?php
namespace App\Nova;

use Laravel\Nova\Http\Requests\NovaRequest;
use Laravel\Nova\Resource;
use Ardenthq\EnhancedTextarea\EnhancedTextarea;

final class ResourceName extends Resource
{
    // ....
    public function fields(NovaRequest $request)
    {
        return [
            // ....
            EnhancedTextarea::make('Description', 'description')
                ->rules('nullable', 'string', 'max:1000')
                ->hideFromIndex()
                ->maxLength(1000),
                // ...
        ];
    }
    // ...
}

Development

  1. Run yarn nova:install and yarn install to install all the necessary dependencies for compiling the view components.
  2. Run yarn run dev (or yarn run watch) while making changes to the components in your local environment.
  3. If you change the vue components, ensure to compile for production before making a PR.

Compile for production

  1. Run yarn nova:install and yarn install to install all the necessary dependencies for compiling the view components.
  2. Run yarn run production.

Analyze the code with phpstan

composer analyse

Refactor the code with php rector

composer refactor

Format the code with php-cs-fixer

composer format

Run tests

composer test

Security

If you discover a security vulnerability within this package, please send an e-mail to security@ardenthq.com. All security vulnerabilities will be promptly addressed.

Credits

This project exists thanks to all the people who contribute.

License

MIT © Ardent

Back to Top
Added 3 years ago
Last updated 3 Years Ago
Version 1.0.2
Nova Version ^4.0
Composer
ArdentHQ/nova-enhanced-textarea
GitHub stars 1
Packagist downloads 4,835

Favorites

3 users favorited

Rating

N/A
(out of 5)
★★★★★
★★★★
★★★
★★
0 ratings

Contributors

Brought to you by Tighten

Issues/Feature Requests Stats Package Ideas