client) { $transformer = new ClientTransformer($this->account, $this->serializer); return $this->includeItem($task->client, $transformer, 'client'); } else { return null; } } public function transform(Task $task) { return array_merge($this->getDefaults($task), [ 'id' => (int) $task->public_id, 'description' => $task->description, 'duration' => $task->getDuration() ]); } }