PHPackages                             c6digital/laravel-orderable - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. c6digital/laravel-orderable

ActiveLibrary[Database &amp; ORM](/categories/database)

c6digital/laravel-orderable
===========================

Straightforward ordering for Laravel models.

v2.0.0(5mo ago)744[2 PRs](https://github.com/c6digital/laravel-orderable/pulls)MITPHPPHP ^8.2CI passing

Since Mar 18Pushed 2mo ago3 watchersCompare

[ Source](https://github.com/c6digital/laravel-orderable)[ Packagist](https://packagist.org/packages/c6digital/laravel-orderable)[ Docs](https://github.com/c6digital/laravel-orderable)[ GitHub Sponsors]()[ RSS](/packages/c6digital-laravel-orderable/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (13)Versions (6)Used By (0)

Straightforward ordering for Laravel models.
============================================

[](#straightforward-ordering-for-laravel-models)

[![Latest Version on Packagist](https://camo.githubusercontent.com/8101f16bb0a66a37ea94a12631de4653cf91ae9246cfacb4319eb66333c5204d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f63366469676974616c2f6c61726176656c2d6f7264657261626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/c6digital/laravel-orderable)[![GitHub Tests Action Status](https://camo.githubusercontent.com/d4850ade38aea8611e85d8f6b35111b99f4ca446b299256ff5058619de2484f4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f63366469676974616c2f6c61726176656c2d6f7264657261626c652f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/c6digital/laravel-orderable/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/c292d996a595532c2fcf2741cfbbe0bcd3c661dc46575cfe18e7737bf3182b48/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f63366469676974616c2f6c61726176656c2d6f7264657261626c652f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/c6digital/laravel-orderable/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/ce1c9fc4c9c1a5e364e8a92ab82fc9e20a5be4cdd36c7571ef000e8778cf25fd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f63366469676974616c2f6c61726176656c2d6f7264657261626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/c6digital/laravel-orderable)

This package provides a simple `Orderable` trait that you can implement on your Eloquent models. It registers a couple of scopes that allow you to order models and also handles re-ordering models after creation.

Installation
------------

[](#installation)

You can install the package via Composer:

```
composer require c6digital/laravel-orderable
```

Usage
-----

[](#usage)

Register the `Orderable` trait on your model.

```
use C6Digital\Orderable\Concerns\Orderable;
use C6Digital\Orderable\Concerns\OrderableOptions;

class Post extends Model
{
    use Orderable;

    public static function getOrderableOptions(): OrderableOptions
    {
        return OrderableOptions::default()
            ->column('order')               // Set the column that is used to order this model.
            ->reorderOnCreate()             // Determine whether models should be re-ordered after creation.
            ->moveToEndOnCreate()           // Place newly created models at the end.
            ->moveToStartOnCreate()         // Place newly created models at the start.
            ->setOrderUsing(callback: ...); // Set the order manually using a custom callback.
    }
}
```

> The default column is `order`, so make sure you add that to your database table. The package doesn't do it for you automatically.

Use the `ordered()`, `orderedAsc()` and `orderedDesc()` methods to order results in a query.

```
Post::query()
    ->ordered()     // Defaults to `ASC`.
    ->orderedAsc()  // Orders `ASC`.
    ->orderedDesc() // Orders `DESC`.
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Ryan Chandler](https://github.com/c6digital)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance80

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~681 days

Total

2

Last Release

154d ago

Major Versions

v1.0.0 → v2.0.02026-01-29

### Community

Maintainers

![](https://www.gravatar.com/avatar/568d485d441c691b0358b9091254a6a671fef8f76b73f28af1180ad568d142b2?d=identicon)[ryangjchandler](/maintainers/ryangjchandler)

---

Top Contributors

[![c6andy](https://avatars.githubusercontent.com/u/213634680?v=4)](https://github.com/c6andy "c6andy (11 commits)")[![ryangjchandler](https://avatars.githubusercontent.com/u/41837763?v=4)](https://github.com/ryangjchandler "ryangjchandler (10 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (7 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (4 commits)")

---

Tags

laravelC6 Digitallaravel-orderable

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/c6digital-laravel-orderable/health.svg)

```
[![Health](https://phpackages.com/badges/c6digital-laravel-orderable/health.svg)](https://phpackages.com/packages/c6digital-laravel-orderable)
```

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k102.4M1.4k](/packages/spatie-laravel-permission)[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M46](/packages/spatie-laravel-pdf)[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.1k11.2M97](/packages/dedoc-scramble)[spatie/laravel-passkeys

Use passkeys in your Laravel app

471890.7k37](/packages/spatie-laravel-passkeys)[wnx/laravel-backup-restore

A package to restore database backups made with spatie/laravel-backup.

213389.8k2](/packages/wnx-laravel-backup-restore)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
