$model->uuid, 'content' => $model->content, 'created_at' => $model->created_at ? $model->created_at->toIso8601String() : null ]; } public function includeManager(Chat $model): ?Item { return $model->manager ? $this->item($model->manager, new UserTransformer()) : null; } public function includeClient(Chat $model): ?Item { return $model->client ? $this->item($model->client, new ClientTransformer()) : null; } public function includeMessages(Chat $model): Collection { return $this->collection($model->messages, new MessageTransformer()); } }