Skip to content

Combine multiple Nova fields as one field output

Notifications You must be signed in to change notification settings

inspheric/nova-grouped-field

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nova Grouped Field

Latest Version on Github Total Downloads

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

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

About

Combine multiple Nova fields as one field output

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Vue 55.9%
  • PHP 38.2%
  • JavaScript 5.9%