search fix

This commit is contained in:
Simon Pocrnjič
2024-11-21 21:08:47 +01:00
parent 713bd9ffe3
commit 09fcac7cb5
11 changed files with 126 additions and 262 deletions
+3 -6
View File
@@ -34,13 +34,10 @@ protected function makeAllSearchableUsing(Builder $query): Builder
public function toSearchableArray(): array
{
$array = $this->toArray();
$array['person'] = $this->person ? $this->person->only(['full_name', 'tax_number', 'social_security_number']): null;
$array['person_addresses'] = $this->person->addresses ? $this->person->addresses->only(['adddress'])->toArray() : [];
$array['person_phones'] = $this->person->phones ? $this->person->phones->only(['nu'])->toArray() : [];
return $array;
return [
'person.full_name' => ''
];
}
public function client(): BelongsTo