main
toArray
public function toArray($request) { $fields = array_filter([ 'id' => $this->id, 'name' => $this->name,