protected function resolveModel($data):Model
    {
        if ($data instanceof Model) {
            return $data;
        }

        $model = array_values($data)[0];
        if (! $model instanceof Model) {
            throw new InvalidArgumentException('You can only transform data containing Eloquent models.');
        }

        return $model;
    }