© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
1 reply
Sander

getTableReorderColumn() pivot column

I have 3 models one of which is Pivot::class
Article, Course, ArticleCourse
Article, Course, ArticleCourse

The pivot uses eloquent-sortable, the Pivot implements
Sortable
Sortable
and uses the
SortableTrait
SortableTrait
.
Upon attaching thus creating a pivot record the
'sort_when_creating' => true,
'sort_when_creating' => true,
doesn't seem to fire.
Also with:
 protected function getTableReorderColumn(): ?string
    {
        return 'article_course.order_column'; //or 'order_column, both fail;
    }
 protected function getTableReorderColumn(): ?string
    {
        return 'article_course.order_column'; //or 'order_column, both fail;
    }

When dragging and dropping the records I get:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'article_course.order_column' in 'field list' (Connection: mysql, SQL: update `articles` set `article_course`.`order_column` = 1, `articles`.`updated_at` = 2023-04-03 20:28:40 where `id` = 15)
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'article_course.order_column' in 'field list' (Connection: mysql, SQL: update `articles` set `article_course`.`order_column` = 1, `articles`.`updated_at` = 2023-04-03 20:28:40 where `id` = 15)


Any suggestions as how to solve this issue? Are there existing solutions available?

Justification:
Some articles can be reused within other courses lets say a common recurring one like how to install something.

It is to be used within a many to many relationship manager
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Pivot Column Reorder
FilamentFFilament / ❓┊help
3y ago
Tenancy pivot columns
FilamentFFilament / ❓┊help
3y ago
Related record, pivot extra column values
FilamentFFilament / ❓┊help
3y ago
Pivot table with extra json column
FilamentFFilament / ❓┊help
3y ago