Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Nova Header Field Laravel Package

ngiraud/nova-header-field

A Laravel Nova field that adds a clean header or section title inside resource forms and detail views, making long layouts easier to scan and organize without custom HTML.

View on GitHub
Deep Wiki
Context7

Getting Started

Install the package with Composer and confirm it is compatible with your installed Nova version before wiring it into resources:

composer require ngiraud/nova-header-field

Look first at:

  • composer.json — especially the laravel/nova constraint and extra.laravel.providers.
  • src/Header.php — confirm the namespace, class name, and inherited Nova field methods.
  • The package service provider — it should register the compiled field asset via Nova::script(...).
  • dist/js/field.js or resources/js/... — useful if the header renders blank and you need to debug asset loading.

The first use case is a long resource form that needs visual grouping without adding panels. Import the field and place it directly in the resource’s fields() method:

use Ngiraud\NovaHeaderField\Header;

public function fields(Request $request)
{
    return [
        Header::make('Account Information')->hideFromIndex(),

        Text::make('Name'),
        Email::make('Email'),

        Header::make('Address')->hideFromIndex(),

        Text::make('Street'),
        Text::make('City'),
        Text::make('Postal Code'),
    ];
}

The heading text is the field’s display name passed to make(). Hide it from index views so it does not appear as an empty or non-data column.

Implementation Patterns

Use headers as lightweight sub-section dividers inside panels. Panels are still the right tool for major page sections; headers work best to break up a long panel without adding another card or panel boundary.

Panel::make('Customer', [
    Header::make('Identity')->hideFromIndex(),
    Text::make('First Name'),
    Text::make('Last Name'),

    Header::make('Contact')->hideFromIndex(),
    Email::make('Email'),
    Phone::make('Phone'),
]),

Control where the header appears. Because it is a Nova field, it participates in the same visibility pipeline as other fields. Common combinations:

Header::make('Billing Details')
    ->hideFromIndex();

Header::make('Internal Notes')
    ->onlyOnForms();

Header::make('Audit Information')
    ->onlyOnDetail();

Verify the exact methods inherited by Header in src/Header.php; standard Nova visibility methods usually work because the class extends Nova’s base field, but the package predates several Nova releases.

Extract reusable field groups. For resources with repeated sections across create, update, and detail views, return arrays from private methods:

private function addressFields(): array
{
    return [
        Header::make('Address')->hideFromIndex(),
        Text::make('Street'),
        Text::make('City'),
        Text::make('Postal Code'),
    ];
}

public function fields(Request $request)
{
    return [
        ...$this->addressFields(),
    ];
}

Localize headings normally. Since the heading is the field name, translation helpers work naturally:

Header::make(__('Contact Information'))->hideFromIndex(),

Use headers instead of raw HTML or custom panels for simple grouping. The package’s value is that it stays inside the Nova field stack, so ordering, visibility, and panel placement behave like any other field. Avoid injecting HTML through ->asHtml() or similar unless the package explicitly supports it.

Gotchas and Tips

Nova compatibility is the main risk. The last release was in 2018, so the package was built for an early Nova version. Check the laravel/nova constraint in its composer.json. If Composer refuses installation on Nova 3 or 4, you will need to fork the package, widen the constraint, and verify the Vue component still works. The PHP field class may be fine while the compiled frontend asset is not.

A blank header usually means the field asset did not load. Check the browser console and network tab for the package’s field.js. If the service provider was not auto-discovered, add the provider listed under extra.laravel.providers in the package’s composer.json to config/app.php. After asset changes, clear Nova/cache artifacts as appropriate for your Nova version.

Do not treat it as a data field. Avoid ->rules(), ->sortable(), ->nullable(), or index/export usage. It has no database attribute to resolve. Use ->hideFromIndex() consistently, or omit it from any dedicated index field set.

Panel scoping matters. A header inside a Panel only spans that panel. If a page has multiple panels, a single header cannot visually span all of them. Place a header at the top of each panel or restructure the form if you need a full-width section break.

The first make() argument is the heading, not an attribute. Do not pass column names unless the column name is also the intended heading text. If you need a different internal attribute, inspect the class before relying on the second argument; the package’s documented behavior is heading text via make('...').

Styling is intentionally minimal. There is no configuration layer described. If the default heading does not match your admin theme, override it with CSS registered through Nova::style() or your application’s Nova CSS. Avoid reaching into compiled assets unless you are prepared to rebuild them.

Be cautious with low-maintenance dependencies. With a small star count, no dependents, and a 2018 release, treat this as a convenience package rather than infrastructure. For production on modern Nova, a tiny local custom field that renders an <h3> section heading is often safer and easier to maintain than pinning an old frontend asset. If you keep the package, pin the version and test both form and detail views after every Nova upgrade.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource