Benjacho / belongs-to-many-field-nova

Belongs To Many field Laravel nova to represent many to many relationship in field.
MIT License
157 stars 80 forks source link

Updating a model empties my BelongsToMany field #98

Open 1stevengrant opened 2 years ago

1stevengrant commented 2 years ago

I believe this is a recent thing but when I first create a new nova resource and select my relations, they are just fine and dandy.

However, if I make another edit to the resource, when I save, my BelongsToMany relationship vanishes.

Defined as so:

BelongsToManyField::make('Authors', 'authors', 'App\Nova\Author')
                ->optionsLabel('full_name')
                ->rules('required')
                ->help('Who is featured in this video?'),

If I reassign the authors again, that works too.