dillingham/nova-grouped-field

Combine Nova fields into one output

Installs: 123 564

Dependents: 0

Suggesters: 0

Security: 0

Stars: 41

Watchers: 2

Forks: 3

Open Issues: 1

Language:Vue

0.11 2020-01-12 02:33 UTC

This package is auto-updated.

Last update: 2024-11-29 06:02:04 UTC


README

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()

removeLinks()

If you just want plain text output for relationships

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

Screenshots

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