Skip to content

ngiraud/nova-header-field

Repository files navigation

Nova Header Field

Simple field to add a header to separate panels in the form.

Nova Header Field

Installation

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

composer require ngiraud/nova-header-field

Usage

Add the field to your Nova resource fields method :

public function fields(Request $request)
    {
        return [
            (new Panel(__('General'), [

                FormHeader::make(__('General')),

                Text::make(__('Firstname'), 'firstname'),
                Text::make(__('Lastname'), 'lastname'),
                Text::make(__('Email'), 'email'),
                ...
            ]))->withToolbar(),

            new Panel(__('Address'), [

                FormHeader::make(__('Address')),

                Text::make(__('Address 1'), 'address_1'),
                Text::make(__('Address 2'), 'address_2'),
                Text::make(__('Postal Code'), 'postal_code'),
                Text::make(__('City'), 'city'),
                Text::make(__('Country'), 'country'),
                ...
            ]),
        ];
    }

Changelog

Please see CHANGELOG for more information on what has changed recently.

Security

If you discover any security related issues, please email contact@ngiraud.me instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.