diff --git a/app/Form/Actions/ParticipantIndexAction.php b/app/Form/Actions/ParticipantIndexAction.php index bb7e3a5f..8e260a7c 100644 --- a/app/Form/Actions/ParticipantIndexAction.php +++ b/app/Form/Actions/ParticipantIndexAction.php @@ -6,7 +6,6 @@ use App\Form\Models\Form; use App\Form\Models\Participant; use App\Form\Resources\ParticipantResource; use App\Form\Scopes\ParticipantFilterScope; -use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Http\Resources\Json\AnonymousResourceCollection; use Laravel\Scout\Builder; use Lorisleiva\Actions\Concerns\AsAction; @@ -16,7 +15,7 @@ class ParticipantIndexAction use AsAction; /** - * @return HasMany + * @return Builder */ protected function getQuery(Form $form, ParticipantFilterScope $filter): Builder { diff --git a/app/Form/Fields/Field.php b/app/Form/Fields/Field.php index 043d1c07..c334dd07 100644 --- a/app/Form/Fields/Field.php +++ b/app/Form/Fields/Field.php @@ -180,4 +180,10 @@ abstract class Field extends Data { return app(SingleValueMatcher::class); } + + /** @param mixed $value */ + public function filter($value): string + { + return ''; + } } diff --git a/app/Form/Models/Participant.php b/app/Form/Models/Participant.php index f28247e6..96c446ca 100644 --- a/app/Form/Models/Participant.php +++ b/app/Form/Models/Participant.php @@ -104,11 +104,12 @@ class Participant extends Model implements Preventable return 'Nachweise erforderlich für deine Anmeldung zu ' . $this->form->name; } - public function searchableAs() + public function searchableAs(): string { return $this->form->participantsSearchableAs(); } + /** @return array */ public function toSearchableArray(): array { return [...$this->data, 'parent-id' => $this->parent_id]; diff --git a/app/Form/Scopes/ParticipantFilterScope.php b/app/Form/Scopes/ParticipantFilterScope.php index 7f3606ed..e34baa41 100644 --- a/app/Form/Scopes/ParticipantFilterScope.php +++ b/app/Form/Scopes/ParticipantFilterScope.php @@ -13,7 +13,7 @@ use Spatie\LaravelData\Attributes\MapOutputName; use Spatie\LaravelData\Mappers\SnakeCaseMapper; /** - * @extends Filter + * @extends ScoutFilter */ #[MapInputName(SnakeCaseMapper::class)] #[MapOutputName(SnakeCaseMapper::class)] @@ -25,6 +25,7 @@ class ParticipantFilterScope extends ScoutFilter /** * @param array $data + * @param array $options */ public function __construct( public array $data = [],