ardenthq/nova-enhanced-textarea

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

Custom textarea field with character count

1.0.2 2022-09-22 09:24 UTC

This package is auto-updated.

Last update: 2022-11-24 09:25:13 UTC


README

banner.jpeg

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

screenshot-1.png screenshot-2.png

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