loafer / laravel-sortable
Laravel package for sorting models
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
pkg:composer/loafer/laravel-sortable
Requires
- php: ^7.4|^8.0|^8.1|^8.2
This package is auto-updated.
Last update: 2025-10-06 16:36:44 UTC
README
Installation
composer require loafer/laravel-sortable
Usage
Just add the trait to your model.
<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class Post extends Model { use \Loafer\Sortable; }
Configure sort column name
By default, the package will use sort_order
column to store the sort value.
If you want to use another column, just add a sortColumn
property to your model.
class Post extends Model { use \Loafer\Sortable; public $sortColumn = 'order'; }