This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

billyZduke
billyZduke

I've got a simple Slideshow plugin that I've made in Builder. There are two tables, sliders and slides, and in my model PHP files, a slider hasMany slides, and a slide belongsTo a slider.

I'd like the ability for backend admins to arbitrarily edit the order of the slides belonging to a given slider, so it seems that I might want to use the Sortable trait on my slide model... But that will apply a global order to all slides, independent of the slider they belongTo, which is not really what I need.

  1. Is it possible to use an arbitrary sort_order and the Sortable trait in this fashion?
  2. Can it be done without having to change my relationship to belongsToMany and using a sort_order column in a sliders_slides pivot table?
  3. And even if I must create a pivot table to make this work, how would I get Sortable to focus on the sort_order column in the pivot table rather than looking at the one in the slides table?

Thanks in advance for any tips you can offer...

Last updated

1-1 of 1

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.