First you must install this package in to a Laravel app that uses Nova via composer:
composer require scouser03/nova-collapse-field
namespace App\Nova;
use Laravel\Nova\Panel;
use Laravel\Nova\Fields\Text;
use Scouser03\NovaCollapseField\NovaCollapseField;
class BlogPost extends Resource
{
// ...
public function fields(Request $request)
{
return [
// ...
(new Panel('Panel name', [
NovaCollapseField::make('Panel name'),
Text::make(__('Tag'), 'tag')
->creationRules('required')
->rules('required')
->sortable(),
]))->help('icon'),
// ...
];
}
}
->help() method is required
The MIT License (MIT). Please see License File for more information.