spatie / laravel-query-builder

Easily build Eloquent queries from API requests
https://spatie.be/docs/laravel-query-builder
MIT License
4.02k stars 397 forks source link

V4 - Dynamic parameter names #724

Closed ManukMinasyan closed 2 years ago

ManukMinasyan commented 2 years ago

Hi guys this is my first contribution to Spatie. I will be glad to hear your opinions. Thank you.

Usage example:

QueryBuilder::for($feedback->comments(), null, [
    'sort' => 'discussionSort'
])
freekmurze commented 2 years ago

Could you also update the readme and add tests. Maybe also provide a little bit of context why you would need this feature.

ManukMinasyan commented 2 years ago

Okay. I update the readme and add tests. I have a page where lists are linked to each other, and filtering and sorting work on both sides, which is why this functionality is needed.

Screenshot from 2022-02-08 17-11-11

saibotk commented 2 years ago

This is super useful for pages with multiple tables, we also have many use cases and would love to see this feature.

spatie-bot commented 2 years ago

Dear contributor,

because this pull request seems to be inactive for quite some time now, I've automatically closed it. If you feel this pull request deserves some attention from my human colleagues feel free to reopen it.