eminiarts/nova-relationship-selector

A Laravel Nova Package to group Relationships into a Selector.

Maintainers

👁 bajramemini

Package info

github.com/eminiarts/nova-relationship-selector

pkg:composer/eminiarts/nova-relationship-selector

Statistics

Installs: 69 970

Dependents: 2

Suggesters: 0

Stars: 27

Open Issues: 16

1.0.0 2020-03-22 09:34 UTC

Requires

  • php: >=7.1.0

Requires (Dev)

None

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 758056a93749a63619f40cb879e324ae4ec178de

novalaravel


README

👁 Latest Version on Github
👁 Total Downloads

Display your resource's relationships with a dropdown vs endless scrolling

👁 image

Installation

You can install the package in to a Laravel app that uses Nova via composer:

composer require eminiarts/nova-relationship-selector

Usage

use Eminiarts\RelationshipSelector\RelationshipSelector;
public function fields()
{
 return [
 
 // ...
 
 RelationshipSelector::make('Relations')
 ->addOption('Invoices', HasMany::make('Invoices'))
 ->addOption('Notes', HasMany::make('Notes'))
 ->addOption('Contacts', HasMany::make('Contacts'))
 ->addOption('Tags', MorphToMany::make('Tags')),
 
 // ...
 
 ];
}

With Select

If you want to display the Select on the right side, you can use the ->withSelect() function.

👁 image