jerry58321 / model-orderbywith
这是Laravel Eloquent Model关系的一种排序方法。
v1.0.0
2023-05-31 10:15 UTC
Requires
- php: >=7.2
- laravel/framework: ^7.0|^8.0
Requires (Dev)
- orchestra/testbench: ^5.0|^6.0|^7.0
- phpunit/phpunit: ^9.6
This package is not auto-updated.
Last update: 2024-10-03 14:38:09 UTC
README
可以使用Composer安装model-orderbywith。请在您的项目目录中运行以下命令:
composer require jerry58321/model-orderbywith
说明
这个程序库是Laravel中Eloquent Builder的扩展方法,能够通过Eloquent Relationships的方式实现关联排序。
除此之外,它还具有以下优化特点:
- 可以利用聚合函数进行排序,提供更灵活的排序需求处理方式。
- 可以在远程关联中进行排序,使得在关联模型之间的远程关联中进行排序成为可能。
- 可以在关联中加入其他条件,进一步细化关联排序的范围和结果。
通过这个程序库,您可以更有效率且便捷地在使用Eloquent Builder进行关联排序时实现以上功能。