Download the PHP package firevel/sortable without Composer
On this page you can find all versions of the php package firevel/sortable. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package sortable
Laravel Sortable
A simple trait to make your Laravel Eloquent models sortable with ease.
Installation
Using Composer:
Setup
-
Import the
Sortable
trait in your Eloquent model. - Add a protected
$sortable
array property to your model. This array should list the fields you want to allow for sorting.
Example:
Usage
You can now easily sort your models using the sort()
query scope.
Ascending Order:
To sort by name
in ascending order:
Descending Order:
To sort by id
in descending order:
The -
sign before the field name indicates descending order.
All versions of sortable with dependencies
PHP Build Version
Package Version
No informations.
The package firevel/sortable contains the following files
Collapse All