PHPackages                             bluehousegroup/dinkly-sortable - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. bluehousegroup/dinkly-sortable

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

bluehousegroup/dinkly-sortable
==============================

Provides a trait that adds sortable behavior to a Dinkly Data Model.

03PHP

Since Aug 8Pushed 6y ago8 watchersCompare

[ Source](https://github.com/bluehousegroup/dinkly-sortable)[ Packagist](https://packagist.org/packages/bluehousegroup/dinkly-sortable)[ RSS](/packages/bluehousegroup-dinkly-sortable/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Sortable Model Module for Dinkly
================================

[](#sortable-model-module-for-dinkly)

Description
-----------

[](#description)

This module provides a trait that adds sortable behavior to a Dinkly Data Model.

Usage
-----

[](#usage)

To add sortable behaviour to your model you must:

1. Implement the `BluehouseGroup\DinklySortable\SortableModel` interface.
2. Use the trait `BluehouseGroup\DinklySortable\Sortable trait`.

Optionally, you may specify the name of the sorting column using a (public) static variable called `$sort_column`. If not specified, it will default to `position`.

```
use BluehouseGroup\DinklySortable\Sortable;
use BluehouseGroup\DinklySortable\SortableTrait;

class MyModel extends BaseMyModel implements SortableModel
{
    use Sortable;

    public static $sort_column = 'position';
}

```

You can reorder a model in the following fashion:

```
$model = new MyModel($db);
$model->init(500);
$model->reorder(4);

```

Note that you will not be able to reorder an unsaved record.

By default, the trait will try to reorder ALL the records in the table. If you'd like to reorder relative to a certain group of records you can override the `getSortableFilters` method in your model class:

```
public function getSortableFilters()
{
    return [
        'category_id' => $this->getCategoryId(),
        'is_deleted' => false,
    ];
}

```

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/1ee777069a4275e01924525575d5ff4edfce681e1549f39f1f61d274a1ebe15c?d=identicon)[siebs](/maintainers/siebs)

---

Top Contributors

[![bigSiebs](https://avatars.githubusercontent.com/u/11037603?v=4)](https://github.com/bigSiebs "bigSiebs (4 commits)")

### Embed Badge

![Health badge](/badges/bluehousegroup-dinkly-sortable/health.svg)

```
[![Health](https://phpackages.com/badges/bluehousegroup-dinkly-sortable/health.svg)](https://phpackages.com/packages/bluehousegroup-dinkly-sortable)
```

PHPackages © 2026

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