© 2026 Hedgehog Software, LLC

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

Reordable pivot table in Relation Manager

I have 3 tables:
* categories (id, name)
* attributes (id, name)
* attribute_category (category_id, attribute_id, order) - pivot table

I have AttributesRelationManager in Category Edit page:
class AttributesRelationManager extends RelationManager
{
...
protected static string $relationship = 'attributes';
...
public function table(Table $table): Table
{
  return $table->..
    ->columns([
        Tables\Columns\TextColumn::make('order'),
        Tables\Columns\TextColumn::make('name'),
    ])
    ->reorderable('order');
}
...
}
class AttributesRelationManager extends RelationManager
{
...
protected static string $relationship = 'attributes';
...
public function table(Table $table): Table
{
  return $table->..
    ->columns([
        Tables\Columns\TextColumn::make('order'),
        Tables\Columns\TextColumn::make('name'),
    ])
    ->reorderable('order');
}
...
}


It shows category attributes nicely, ordered by
order
order
field in
attribute_category
attribute_category


But then i try to reorder those displayed attributes, it generates DB error:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'order' in 'field list'

update
  `attributes`
SET
  `ORDER` = CASE
...
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'order' in 'field list'

update
  `attributes`
SET
  `ORDER` = CASE
...


What am i missing here?
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

Relation Manager for pivot table
FilamentFFilament / ❓┊help
2y ago
Pivot cast in relation manager
FilamentFFilament / ❓┊help
2y ago
TextInputColumn on pivot table inside relation manager
FilamentFFilament / ❓┊help
2y ago
Save relation manager order to pivot table
FilamentFFilament / ❓┊help
3y ago