Downloads
Stars
Version
A custom Textarea Field for Nova with character count
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.
composer require ardenthq/nova-enhanced-textarea
Add the EnhancedTextarea
field to your Nova Resource.
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),
// ...
];
}
// ...
}
yarn nova:install
and yarn install
to install all the necessary dependencies for compiling the view components.yarn run dev
(or yarn run watch
) while making changes to the components in your local environment.yarn nova:install
and yarn install
to install all the necessary dependencies for compiling the view components.yarn run production
.phpstan
composer analyse
rector
composer refactor
php-cs-fixer
composer format
composer test
If you discover a security vulnerability within this package, please send an e-mail to [email protected]. All security vulnerabilities will be promptly addressed.
This project exists thanks to all the people who contribute.