You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi
When you create your configuration in table class with the use of configure() method, it's just fine for simple configs. But when you need some custom calculation, you use for() method with spatie-query-builder. For example, you need custom sort for one of the columns. In this case you need to duplicate the configuration in both methods: allowedSorts(), allowedFilters() in for() method and sortable, searchable attributes in configure() method.
Is there a way to configure them in one place in case of custom filter/order implementation?
This discussion was converted from issue #348 on March 20, 2024 13:02.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi
When you create your configuration in table class with the use of
configure()
method, it's just fine for simple configs. But when you need some custom calculation, you usefor()
method with spatie-query-builder. For example, you need custom sort for one of the columns. In this case you need to duplicate the configuration in both methods:allowedSorts()
,allowedFilters()
infor()
method andsortable
,searchable
attributes inconfigure()
method.Is there a way to configure them in one place in case of custom filter/order implementation?
Beta Was this translation helpful? Give feedback.
All reactions