PHPackages                             deeplace/rankable - 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. deeplace/rankable

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

deeplace/rankable
=================

Provides useful methods to make an eloquent collection rankable

017↓90%PHP

Since Mar 30Pushed 3mo agoCompare

[ Source](https://github.com/Deeplace/rankable)[ Packagist](https://packagist.org/packages/deeplace/rankable)[ RSS](/packages/deeplace-rankable/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Installation
============

[](#installation)

add in composer

```
    "repositories": [
        {
            "type": "vcs",
            "url": "git@gitlab.top.md:terranet/rankable.git"
        }
    ],
    "require": {
        "terranet/rankable": "dev-master"
    }
```

```
composer update
```

### Usage example

[](#usage-example)

```
class Program extends Repository implements Translatable, Rankable
{
    use HasRankableField;

    // optional
    protected $rankableColumn = 'rank';

    protected $rankableIncrementValue = 2;

    protected $rankableGroupByColumn = 'member_id';
}
```

now Program::all() will contain orderBy('rank', 'asc') statement

to disable default orderBy statement use:

```
Program::unRanked()
```

to sync rankings call:

```
$model = new Program;
$model->syncRanking([
    1 => 3,
    2 => 2,
    3 => 1
]);
```

where key =&gt; id, value =&gt; rank

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance55

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

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/a469bece99fa263e346a2a7a7b2e19d50a02689d89f466e0fedb8d56eb2138e6?d=identicon)[deeplace](/maintainers/deeplace)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/deeplace-rankable/health.svg)

```
[![Health](https://phpackages.com/badges/deeplace-rankable/health.svg)](https://phpackages.com/packages/deeplace-rankable)
```

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k116.5M113](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[pgvector/pgvector

pgvector support for PHP

198628.3k10](/packages/pgvector-pgvector)

PHPackages © 2026

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