fix 5
This commit is contained in:
parent
1620136d7d
commit
e66eb6436c
|
|
@ -40,10 +40,11 @@ public function toSearchableArray(): array
|
||||||
'addresses' => $this->person->addresses,
|
'addresses' => $this->person->addresses,
|
||||||
'phones' => $this->person->phones
|
'phones' => $this->person->phones
|
||||||
];*/
|
];*/
|
||||||
|
$this->loadMissing('person');
|
||||||
|
|
||||||
$array = $this->toArray();
|
$array = $this->toArray();
|
||||||
|
|
||||||
$array['person'] = $this->person ? $this->person->only('full_name') : null;
|
$array['person_full_name'] = $this->person ? $this->person->full_name: null;
|
||||||
|
|
||||||
return $array;
|
return $array;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,9 +34,11 @@ protected function makeAllSearchableUsing(Builder $query): Builder
|
||||||
|
|
||||||
public function toSearchableArray(): array
|
public function toSearchableArray(): array
|
||||||
{
|
{
|
||||||
|
$this->loadMissing('person');
|
||||||
|
|
||||||
$array = $this->toArray();
|
$array = $this->toArray();
|
||||||
|
|
||||||
$array['person'] = $this->person ? $this->person->only('full_name') : null;
|
$array['person_full_name'] = $this->person ? $this->person->full_name: null;
|
||||||
|
|
||||||
return $array;
|
return $array;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,6 @@ class Person extends Model
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $hidden = [
|
protected $hidden = [
|
||||||
'id',
|
|
||||||
'deleted',
|
'deleted',
|
||||||
'user_id'
|
'user_id'
|
||||||
];
|
];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user