FilamentF
Filament•8mo ago
YoBoi

đź§© How to Use reorderable() with Pivot Table Columns in Many-to-Many Relationships?

Hi! I’m trying to implement row reordering using Filament’s ->reorderable() method, but the order I need to update lives in a pivot table of a many-to-many relationship.

Has anyone successfully used ->reorderable() to update an order column in a pivot table?

For example, suppose we have Project and Task models with a many-to-many relationship, and the pivot table project_task contains an order column. I want to be able to reorder tasks within a project and have it update project_task.order.

What would be the correct approach to get reordering to work in this kind of setup?

Any small working example or tip would be really appreciated. 🙏
Was this page helpful?