thecodemill / eloquent-sort
0.1
2021-04-07 08:53 UTC
Requires
- illuminate/database: >=5.0
This package is auto-updated.
Last update: 2025-05-07 18:15:01 UTC
README
Add simple sortability to Eloquent models.
Installation
Install the EloquentSort package via Composer:
composer require thecodemill/eloquent-sort
Usage
As the name suggests, this package is intended for use with Eloquent and therefor works seamlessly with Laravel.
EloquentSort allows you to define sort handlers on any of your app's models to make sorting model queries much simpler. A sort handler is very similar to a local scope, but by using the Model::sort()
method, any number of scopes may be applied at once without the need for chaining the individual scopes or query modifiers.