question = $question; parent::__construct($questionStats); } /** * Transform the resource into an array. * * @param mixed $request * @return array */ // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass, Squiz.Commenting.FunctionComment.Missing public function toArray($request) { return [ 'answers' => (new AnswersResource($this->question->answers))->toArray($request), 'stats' => $this->collection->toArray() ]; } }