belongs-to-many-field-nova icon indicating copy to clipboard operation
belongs-to-many-field-nova copied to clipboard

Added allow to create related resource

Open dom1no opened this issue 3 years ago • 2 comments

Resolve issue #28

A new method has been added:

  • Method creatable(), This method allows you to create related resource
    // simple
     BelongsToManyField::make('Participants', 'participant', 'App\Nova\Participant')
     ->creatable(),

    // with settings
     BelongsToManyField::make('Participants', 'participant', 'App\Nova\Participant')
     ->creatable('Create new participant', ['additional_participant_field' => 'value']),

Used tagging functionality: https://vue-multiselect.js.org/#sub-tagging

dom1no avatar Oct 04 '20 13:10 dom1no

Looks great, in what scenario do you need this feature?

Benjacho avatar Apr 24 '21 23:04 Benjacho

I created a fork just to get this functionality. I have the same use case (needing to create a new related resource). Would advise to merge.

infostreams avatar Apr 29 '21 13:04 infostreams