2024-12-11 22:32:23 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Form\Actions;
|
|
|
|
|
|
|
|
use App\Form\Models\Form;
|
|
|
|
use Lorisleiva\Actions\Concerns\AsAction;
|
|
|
|
|
|
|
|
class UpdateParticipantSearchIndexAction
|
|
|
|
{
|
|
|
|
use AsAction;
|
|
|
|
|
|
|
|
public function handle(Form $form): void
|
|
|
|
{
|
|
|
|
$form->searchableUsing()->updateIndexSettings(
|
|
|
|
$form->participantsSearchableAs(),
|
|
|
|
[
|
2024-12-12 00:30:59 +01:00
|
|
|
'filterableAttributes' => [...$form->getFields()->filterables()->getKeys(), 'parent-id'],
|
2024-12-11 22:36:25 +01:00
|
|
|
'searchableAttributes' => $form->getFields()->searchables()->getKeys(),
|
2024-12-11 22:32:23 +01:00
|
|
|
'sortableAttributes' => [],
|
2024-12-11 22:36:25 +01:00
|
|
|
'displayedAttributes' => [...$form->getFields()->filterables()->getKeys(), ...$form->getFields()->searchables()->getKeys(), 'id'],
|
2024-12-11 22:32:23 +01:00
|
|
|
'pagination' => [
|
|
|
|
'maxTotalHits' => 1000000,
|
|
|
|
]
|
|
|
|
]
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|