laveroadmin / grid-sortable
Sort the grid data by drag and drop rows for LaveroAdmin
v1.0.0
2026-11-24 11:35 UTC
Requires
- php: >=7.3.0
- laravel/framework: ^7.0|^8.0|^9.0|^10.0|^11.0|^12.0|^13.0
- laveroadmin/laveroadmin: ^1.0
- spatie/eloquent-sortable: ^3.11|^4.0|^5.0
Requires (Dev)
- phpunit/phpunit: ~6.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-26 05:13:56 UTC
README
Sort grid rows by dragging and dropping for LaveroAdmin.
Repository: https://github.com/LaveroAdmin/grid-sortable
Installation
composer require laveroadmin/grid-sortable
Usage
- In your Eloquent Model, use
Spatie\EloquentSortable\SortableTrait:
use Illuminate\Database\Eloquent\Model; use Spatie\EloquentSortable\Sortable; use Spatie\EloquentSortable\SortableTrait; class Item extends Model implements Sortable { use SortableTrait; public $sortable = [ 'order_column_name' => 'order_column', 'sort_when_creating' => true, ]; }
- Enable in your Grid:
$grid = new Grid(new Item()); $grid->sortable();
After dragging rows, click the "Save order" button that appears at the top of the grid to persist the new order.
License
Licensed under The MIT License (MIT).
Thanks
- Special thanks to open-admin for open-admin development.
- Special thanks to z-song for original development.