laravel-order-by-field maintained by oneduo
Description
Laravel query builder order by field method
Author
Last update
2023/10/09 04:05
(dev-dependabot/github_actions/stefanzweifel/git-auto-commit-action-5)
License
Downloads
15
Tags
Laravel query builder - order by field
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.