LastDragon-ru / lara-asp

Awesome Set of Packages for Laravel
MIT License
11 stars 1 forks source link

`@sortBy`: aggregation support #112

Open LastDragon-ru opened 10 months ago

LastDragon-ru commented 10 months ago

Relations can be used for sorting. So should not be a problem to reuse the code to sort by aggregated values. Also, would be good limit avaialable functions for each type (inspired by https://github.com/nuwave/lighthouse/issues/2487).

Probably the best/easy way is to add a new extra operator aggregate. Need to think how it should look, especially if we want type filtering.

https://www.db-fiddle.com/f/7DpjCeQyNMUTXx6gTHCRVv/0