Skip to content

oneduo/laravel-order-by-field

Repository files navigation

Laravel query builder - order by field

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This package adds a orderByField macro on the query Builder.

Installation

You can install the package via composer:

composer require oneduo/laravel-order-by-field

Usage

$keys = [42, 1, 100]
$users = User::query()
    ->whereKey($keys)
    ->orderByField('id', $keys)
    ->get();

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.