build editor
This commit is contained in:
+13
-1
@@ -22,9 +22,21 @@ class Record implements JsonSerializable
|
||||
}
|
||||
|
||||
|
||||
private function indexValues(array $arrObject){
|
||||
|
||||
return trim(Str::lower(collect($arrObject)
|
||||
->map(function($value){
|
||||
if(!is_string($value)){
|
||||
return $this->indexValues($value ?? []);
|
||||
}
|
||||
return $value;
|
||||
})
|
||||
->values()->join(" ")." ". $this->_file?->originalName ?? ""));
|
||||
}
|
||||
|
||||
public function toDB(): array
|
||||
{
|
||||
$searchIndex = trim(Str::lower(collect($this->data)->values()->join(" ")." ". $this->_file?->originalName ?? ""));
|
||||
$searchIndex = $this->indexValues($this->data->toArray());
|
||||
return [
|
||||
"id" => $this->id,
|
||||
"status" => $this->status->value,
|
||||
|
||||
Reference in New Issue
Block a user