use getOptionsFormComponents to adjust export query

Hi - i'm using getOptionsFormComponents to add a new dropdown to my exporter class, how can i pass the value of the dropdown to the modifyQuery() method to filter by results? In the docs it only seems to mention adding options() to closure functions but getOptionsFormComponents() is static
Solution:
Unfortunately you need to add it to the modifyQueryUsing() call on the exporter action wherever it's used, not the class itself. The form options are available via array $data on that
Jump to solution
3 Replies
Solution
Tetracyclic
Tetracyclic7mo ago
Unfortunately you need to add it to the modifyQueryUsing() call on the exporter action wherever it's used, not the class itself. The form options are available via array $data on that
Tetracyclic
Tetracyclic7mo ago
ExportAction::make()
->modifyQueryUsing(function (Builder $query, array $data) {
$data['dropdown_name'];
})
ExportAction::make()
->modifyQueryUsing(function (Builder $query, array $data) {
$data['dropdown_name'];
})
yandos666
yandos666OP7mo ago
Awesome, thanks @Tetracyclic!
Want results from more Discord servers?
Add your server