PHPackages                             marmarait/laraveldynamicsort - 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. marmarait/laraveldynamicsort

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

marmarait/laraveldynamicsort
============================

Lets you sort your Models dynamically by querystring

v1.3.1(7y ago)0227MITPHP

Since Dec 20Pushed 7y ago1 watchersCompare

[ Source](https://github.com/marmarait/laraveldynamicsort)[ Packagist](https://packagist.org/packages/marmarait/laraveldynamicsort)[ RSS](/packages/marmarait-laraveldynamicsort/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (6)Used By (0)

Laravel 5.5 Dynamic Sort
========================

[](#laravel-55-dynamic-sort)

Overview
--------

[](#overview)

Simply sort your Models by using querystring parameters.

Install
-------

[](#install)

`composer require marmarait/laraveldynamicsort`

### Optionally you can also add the jQuery Plugin provided to do the frontend part.

[](#optionally-you-can-also-add-the-jquery-plugin-provided-to-do-the-frontend-part)

`php artisan vendor:publish --provider=MarmaraIT\LaravelDynamicSort\DynamicallySortableProvider`

Somewhere in the part of your layout add

`@include('laraveldynamicsort::short_sort')`

- If you are using gulp simply add "dynamicallySortable.js" to your gulpfile.js
- If you are using laravel-mix add "resources/assets/js/dynamicallySortable.js" to your webpack.mix

Usage
-----

[](#usage)

Backend:

- add the Trait "DynamicallySortable" to your model
- use the scope "ordered" on the model to sort it by querystring:
- add sort=COLUMNAME&amp;dir=\[\[asc/desc\]\] to your query string to sort the active model

To use the jquery-plugin, give the table header(th) elements the attribute data-sort="COLUMNAME" and call the plugin $('.selector').dynamicallySortable() (selector = the th elements; f.e. $('th\[data-sort\]') )

Defaults
--------

[](#defaults)

Set the defaultDir property on your model to define the default order direction (asc/desc)
Set the defaultSort property to set the default sorting column

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity67

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

Every ~64 days

Total

5

Last Release

2856d ago

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/marmarait-laraveldynamicsort/health.svg)

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

PHPackages © 2026

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