https://github.com/dillingham/nova-grouped-field
Combine multiple Nova fields as one field output
https://github.com/dillingham/nova-grouped-field
laravel laravel-nova laravel-nova-field
Last synced: 25 days ago
JSON representation
Combine multiple Nova fields as one field output
- Host: GitHub
- URL: https://github.com/dillingham/nova-grouped-field
- Owner: dillingham
- License: mit
- Created: 2018-11-12T21:28:41.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-12-29T02:28:27.000Z (over 4 years ago)
- Last Synced: 2025-04-16T03:07:42.938Z (about 2 months ago)
- Topics: laravel, laravel-nova, laravel-nova-field
- Language: Vue
- Homepage:
- Size: 25.4 KB
- Stars: 41
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
# Nova Grouped Field
[](https://packagist.org/packages/dillingham/nova-grouped-field)
[](https://packagist.org/packages/dillingham/nova-grouped-field) [](https://twitter.com/im_brian_d)This Nova field provides a clean way to combine multiple fields into one output.

# Installation
Installing with composer:
```bash
composer require dillingham/nova-grouped-field
```# Usage
```php
use Dillingham\NovaGroupedField\Grouped;
```
```php
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
```php
Grouped::make('User')->fields([
BelongsTo::make('Account'),
BelongsTo::make('User'),
])->separator('-')
```### showLabels()
If you want to output the original labels inline with the values
```php
Grouped::make('User')->fields([
BelongsTo::make('Account'),
BelongsTo::make('User'),
])->showLabels()
```
### removeLinks()If you just want plain text output for relationships
```php
Grouped::make('User')->fields([
BelongsTo::make('Account'),
BelongsTo::make('User'),
])->removeLinks()
```
### Screenshots| separator('-') | showLabels() | removeLinks() |
| - | - | -
 |  | ### 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](https://novapackages.com/collaborators/dillingham)
Hope you find it useful. Feel free to reach out with feedback.
Follow me on twitter: [@im_brian_d](https://twitter.com/im_brian_d)