LaravelPackages.net
Acme Inc.
Toggle sidebar
dillingham/nova-grouped-field

Combine Nova fields into one output

141.707
40
0.11
About dillingham/nova-grouped-field

dillingham/nova-grouped-field is a Laravel package for combine nova fields into one output. It currently has 40 GitHub stars and 141.707 downloads on Packagist (latest version 0.11). Install it with composer require dillingham/nova-grouped-field. Discover more Laravel packages by dillingham or browse all Laravel packages to compare alternatives.

Last updated

Nova Grouped Field

Latest Version on Github Total Downloads Twitter Follow

This Nova field provides a clean way to combine multiple fields into one output.

nova-grouped-field-1

Installation

Installing with composer:

composer require dillingham/nova-grouped-field

Usage

use Dillingham\NovaGroupedField\Grouped;
public function fields(Request $request)
{
    return [
        Grouped::make('User')->fields([
            BelongsTo::make('Account'),
            BelongsTo::make('User'),
        ])
    ]
}

Options

There are a few chainable options available

separator($value)

If you would like to override the default slash separator

Grouped::make('User')->fields([
    BelongsTo::make('Account'),
    BelongsTo::make('User'),
])->separator('-')

showLabels()

If you want to output the original labels inline with the values

Grouped::make('User')->fields([
    BelongsTo::make('Account'),
    BelongsTo::make('User'),
])->showLabels()

If you just want plain text output for relationships

Grouped::make('User')->fields([
    BelongsTo::make('Account'),
    BelongsTo::make('User'),
])->removeLinks()

Screenshots

| separator('-') | showLabels() | removeLinks() | | - | - | - nova-grouped-field-separator | nova-grouped-field-labels | nova-grouped-field-no-links

Native options

Grouped is a nova field like any other.

You can use authorization like ->canSee()

You can decide when to show like ->hideFromIndex()


Author

Hi 👋, Im Brian Dillingham, creator of this Nova package and others

Hope you find it useful. Feel free to reach out with feedback.

Follow me on twitter: @im_brian_d

Star History Chart