sort-criteria
There are 2 repositories under sort-criteria topic.
jedrzej/sortable
Sorting functionality for Laravel's Eloquent models
jherax/array-sort-by
Powerful mechanism to sort arrays or array of objects by one or more properties. You can also specify a custom comparer function.