PHPackages                             zigastrgar/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. [Framework](/categories/framework)
4. /
5. zigastrgar/orderable

ActiveLaravel-package[Framework](/categories/framework)

zigastrgar/orderable
====================

Ordering package for Laravel 5.x

v1.1.0(9y ago)20630MITPHPCI failing

Since Oct 8Pushed 9y ago1 watchersCompare

[ Source](https://github.com/ZigaStrgar/orderable)[ Packagist](https://packagist.org/packages/zigastrgar/orderable)[ Docs](https://github.com/ZigaStrgar/orderable)[ RSS](/packages/zigastrgar-orderable/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

Orderable Laravel Package
=========================

[](#orderable-laravel-package)

This is my very first Laravel package. I find it useful for me :) When I work with projects where I need to run a lot of `ORDER BY` queries.

Instalation
-----------

[](#instalation)

Add the Orderable package to your `composer.json` file.

```
{
    "require": {
        "zigastrgar/orderable": "^1.0"
    }
}
```

OR

Simply run this in command line

```
composer require zigastrgar/orderable
```

Usage
-----

[](#usage)

Go to any model and add this to the model.

```
use ZigaStrgar\Orderable\Orderable;

class Article extends Model {
    use Orderable;

    public function orderable(){
        return [
            'id' => 'DESC',
            'title' => 'ASC',
            'user_id'
        ];
    }
}
```

If you don't use the key like in `user_id` case it will default to `DESC`.

### Running "Orderable"

[](#running-orderable)

It's super simple.

```
Article::all();
```

#### Apply only specific rule

[](#apply-only-specific-rule)

From now on, you can also do something like this.

```
Article::order(); //Equals to Article::all();
```

or

```
Article::order(['title']);
```

and only rule for `title` will bi applied.

### Running without "Orderable"

[](#running-without-orderable)

Same. Very simple stuff.

```
Article::unorderable();
```

No scopes applied.

#### Remove specific rule

[](#remove-specific-rule)

```
Article::unorderable(['title']);
```

In this case the rule for title won't be applied.

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3552d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/43781930?v=4)[Zana Strgar](/maintainers/ZStrgar)[@zstrgar](https://github.com/zstrgar)

---

Top Contributors

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

---

Tags

laravellaravel-5-packagelaravel-orderinglaravel-scopes

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.1k91.3M283](/packages/laravel-horizon)[laravel/sail

Docker files for running a basic Laravel application.

1.9k199.2M1.2k](/packages/laravel-sail)[laravel/ai

The official AI SDK for Laravel.

1.0k2.1M169](/packages/laravel-ai)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77018.2M127](/packages/laravel-mcp)[illuminate/routing

The Illuminate Routing package.

1239.0M2.9k](/packages/illuminate-routing)[laravel/surveyor

Static analysis tool for Laravel applications.

8690.3k12](/packages/laravel-surveyor)

PHPackages © 2026

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