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