Yes — you can definitely order records in Filament using your custom order field. You have two good options depending on how interactive you want the sorting to be:
Option 1: Simple ordering (no drag-and-drop)
Just tell Filament to sort the table using your order column:
public static function getEloquentQuery(): Builder
{
return parent::getEloquentQuery()->orderBy('order');
}
This will always display records in the order you set.
You can also add up/down buttons inside the table:
Tables\Actions\Action::make('move_up')
->action(fn ($record) => $record->decrement('order')),
Tables\Actions\Action::make('move_down')
->action(fn ($record) => $record->increment('order')),
Option 2: Drag & Drop Sorting (recommended)
Filament supports drag-and-drop ordering using the Spatie Eloquent Sortable package.
-
Install the package:
composer require spatie/eloquent-sortable
-
Add this to your model:
use Spatie\EloquentSortable\Sortable;
use Spatie\EloquentSortable\SortableTrait;
class YourModel extends Model implements Sortable
{
use SortableTrait;
public $sortable = [
'order_column_name' => 'order',
'sort_when_creating' => true,
];
}
- Enable reordering in your Filament Resource:
public static function canReorder(): bool
{
return true;
}
Now you’ll see a drag-handle in your table and can reorder records with the mouse. Filament will automatically update your order column.
Summary
Yes, ordering is possible
You can use arrows, automatic sorting, or drag-and-drop
Drag-and-drop is built-in when using Spatie’s sortable package
If you want, I can show you the full working code for your specific resource.