private function parseSegments($field)
    {
        $field = starts_with('\\', $field) ? $field : '\\' . $field;

        $segments = explode(':', $field);

        if (count($segments) < 2) {
            throw new \Exception(
                '--includes option should be consist of string value of model, separated by colon(:),
                and string value of relationship. e.g. App\User:author, App\Comment:comments:true.
                If the third element is provided as true, yes, or 1, the command will interpret the include as an collection.'
            );
        }

        $fqcn = array_shift($segments);
        $relationship = array_shift($segments);
        $type = in_array(array_shift($segments), ['yes', 'y', 'true', true, '1', 1])
            ? 'collection' : 'item';

        $namespace = config('api.transformer.namespace');
        $namespace = (starts_with($namespace, '\\') ? $namespace : '\\' . $namespace);
        $namespace = (ends_with($namespace, '\\') ? $namespace : $namespace . '\\');

        $obj = new \stdClass;
        $obj->type = $type;
        $obj->fqcn = $fqcn;
        $obj->model = ltrim($fqcn, '\\');
        $obj->basename = class_basename($fqcn);
        $obj->relationship = $relationship;
        $obj->method = 'include' . ucfirst($relationship);
        $obj->transformer = $namespace . ucfirst($obj->basename) . 'Transformer';

        return $obj;
    }