PHP code example of eminiarts / nova-relationship-selector
1. Go to this page and download the library: Download eminiarts/nova-relationship-selector library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
eminiarts / nova-relationship-selector example snippets
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')),
// ...
];
}