PHPackages                             lifeonscreen/nova-sort-relations - 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. lifeonscreen/nova-sort-relations

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

lifeonscreen/nova-sort-relations
================================

This package improves support for sorting relations in Laravel Nova.

v0.0.2(7y ago)2081.9k↓45%7[2 issues](https://github.com/LifeOnScreen/nova-sort-relations/issues)[1 PRs](https://github.com/LifeOnScreen/nova-sort-relations/pulls)MITPHPPHP &gt;=7.1.0

Since Oct 24Pushed 6y ago2 watchersCompare

[ Source](https://github.com/LifeOnScreen/nova-sort-relations)[ Packagist](https://packagist.org/packages/lifeonscreen/nova-sort-relations)[ RSS](/packages/lifeonscreen-nova-sort-relations/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

LifeOnScreen/nova-sort-relations
--------------------------------

[](#lifeonscreennova-sort-relations)

This package improves support for sorting relations in Laravel Nova.

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

[](#installation)

Install via composer

```
$ composer require lifeonscreen/nova-sort-relations
```

Usage
-----

[](#usage)

Include `LifeOnScreen\SortRelations\SortRelations` trait to your class. Define base by overriding `indexQuery`. Define sortable columns in `$sortRelations` array.

```
...
use LifeOnScreen\SortRelations\SortRelations;
...

class Product extends Resource
{
    public static $sortRelations = [
        // overriding id with product.id (this prevent ambiguous id, if you select multiple ids)
        'id'               => 'product.id',
        // overriding user relation sorting
        'user'         => [
            // sorting multiple columns
            'users.name',
            'users.surname',
        ],
        // overriding company relation sorting
        'company'          => 'company.name',
    ];

    public static function indexQuery(NovaRequest $request, $query)
    {
        // You can modify your base query here.
        return $query;
    }
}
```

Security
--------

[](#security)

If you discover any security-related issues, please email the author instead of using the issue tracker.

Credits
-------

[](#credits)

- [Jani Cerar](https://github.com/janicerar)

License
-------

[](#license)

MIT license. Please see the [license file](docs/license.md) for more information.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 60% 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 ~138 days

Total

2

Last Release

2626d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/38758825?v=4)[LifeOnScreen](/maintainers/LifeOnScreen)[@LifeOnScreen](https://github.com/LifeOnScreen)

---

Top Contributors

[![janicerar](https://avatars.githubusercontent.com/u/29040621?v=4)](https://github.com/janicerar "janicerar (3 commits)")[![anderly](https://avatars.githubusercontent.com/u/573151?v=4)](https://github.com/anderly "anderly (2 commits)")

---

Tags

laravelsortrelationsnova

### Embed Badge

![Health badge](/badges/lifeonscreen-nova-sort-relations/health.svg)

```
[![Health](https://phpackages.com/badges/lifeonscreen-nova-sort-relations/health.svg)](https://phpackages.com/packages/lifeonscreen-nova-sort-relations)
```

###  Alternatives

[optimistdigital/nova-multiselect-field

A multiple select field for Laravel Nova.

3403.5M7](/packages/optimistdigital-nova-multiselect-field)[genealabs/laravel-overridable-model

Provide a uniform method of allowing models to be overridden in Laravel.

92398.0k2](/packages/genealabs-laravel-overridable-model)[inspheric/nova-defaultable

Default values for Nova fields when creating resources and running resource actions.

51174.8k1](/packages/inspheric-nova-defaultable)[murdercode/nova4-tinymce-editor

Boost your Laravel Nova with the TinyMCE editor.

17165.2k](/packages/murdercode-nova4-tinymce-editor)[yieldstudio/nova-google-autocomplete

A Laravel Nova Google autocomplete field.

12218.4k](/packages/yieldstudio-nova-google-autocomplete)[datomatic/nova-detached-actions

A Laravel Nova tool to allow for placing actions in the Nova toolbar detached from the checkbox selection mechanism.

11229.2k](/packages/datomatic-nova-detached-actions)

PHPackages © 2026

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