PHPackages                             adiafora/laravel-postgres-naturalsort - 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. adiafora/laravel-postgres-naturalsort

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

adiafora/laravel-postgres-naturalsort
=====================================

This is a just simple example of how you can add natural sorting to your Eloquent models if you use Postgres.

1.2(3y ago)026MITPHPPHP ^7.4.0 | ^8.0.0

Since Jul 29Pushed 3y ago1 watchersCompare

[ Source](https://github.com/adiafora/laravel-postgres-naturalsort)[ Packagist](https://packagist.org/packages/adiafora/laravel-postgres-naturalsort)[ RSS](/packages/adiafora-laravel-postgres-naturalsort/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

laravel-postgres-naturalsort
============================

[](#laravel-postgres-naturalsort)

This simple package will help you add natural sorting to your Eloquent models if you use PostgreSQL.

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

[](#installation)

Run:

```
    composer require "adiafora/laravel-postgres-naturalsort"
```

Run migration on the package:

```
    php artisan migrate
```

Usage
-----

[](#usage)

You can add a `NaturalSortTrait` to any Eloquent model

```
Product extends Model
{
    use \Adiafora\NaturalSort\NaturalSortTrait;
}
```

And in your client code you can write:

```
Product::orderByNatural('text')->get();
```

or reverse sorting

```
Product::orderByNaturalDesc('text')->get();
```

License
-------

[](#license)

The MIT License (MIT). Please see License File for more information.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 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

Every ~0 days

Total

3

Last Release

1383d ago

PHP version history (2 changes)1.0PHP &gt;=7.2

1.1PHP ^7.4.0 | ^8.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/d4a7033811d36da4fe0bd43c276f2dd8b2b20915d5541cd02049b7b2258b8d70?d=identicon)[ZhidkovSV](/maintainers/ZhidkovSV)

---

Top Contributors

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

---

Tags

phplaravelpostgresqlnatural sort

### Embed Badge

![Health badge](/badges/adiafora-laravel-postgres-naturalsort/health.svg)

```
[![Health](https://phpackages.com/badges/adiafora-laravel-postgres-naturalsort/health.svg)](https://phpackages.com/packages/adiafora-laravel-postgres-naturalsort)
```

###  Alternatives

[tpetry/laravel-postgresql-enhanced

Support for many missing PostgreSQL specific features

9982.0M14](/packages/tpetry-laravel-postgresql-enhanced)[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11320.2M21](/packages/anourvalar-eloquent-serialize)[umbrellio/laravel-pg-extensions

Extensions for Postgres Laravel

102426.5k1](/packages/umbrellio-laravel-pg-extensions)[vcian/laravel-db-auditor

Database DB Auditor provide leverage to audit your MySql,sqlite, PostgreSQL database standards and also provide options to add constraints in table.

28535.1k1](/packages/vcian-laravel-db-auditor)[umbrellio/laravel-ltree

Extension LTree (Postgres) for Laravel

34111.6k](/packages/umbrellio-laravel-ltree)[maikealame/laravel-auto

Laravel helper to make almost everything for your project

414.7k](/packages/maikealame-laravel-auto)

PHPackages © 2026

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