outl1ne / nova-sortable

This Laravel Nova package allows you to reorder models in a Nova resource's index view using drag & drop.
MIT License
284 stars 120 forks source link

BelongsToMany issue #203

Open khalilst opened 5 months ago

khalilst commented 5 months ago

Hi, I'm trying to use sortable for a BelongsToMany relation only. It's working fine for the model but it's not the case I'm looking for. Following documentation here, it asks for sortable settings in the pivot table but I want to sort based on the main model used for the relation.

Example for Artists/Tracks: Let's reorder tracks for each artist. So the track should have an ordering_column which is in the tracks table and not in the artist_track pivot table.

Any idea, please?