<NME> TransformerGenerator.php
<BEF> <?php
namespace Prettus\Repository\Generators;

/**
 * Class TransformerGenerator
 * @package Prettus\Repository\Generators
 * @author Anderson Andrade <contato@andersonandra.de>
 */
class TransformerGenerator extends Generator
{
    /**
     * Get stub name.
     *
     * @var string
     */
    protected $stub = 'transformer/transformer';

    /**
     * Get root namespace.
     *
     * @return string
     */
    public function getRootNamespace()
    {
        return parent::getRootNamespace() . parent::getConfigGeneratorClassPath($this->getPathConfigNode());
    }

    /**
     * Get generator path config node.
     *
     * @return string
     */
    public function getPathConfigNode()
    {
        return 'transformers';
    }

    /**
     * Get destination path for generated file.
     *
     * @return string
     */
    public function getPath()
    {
        return $this->getBasePath() . '/' . parent::getConfigGeneratorClassPath($this->getPathConfigNode(), true) . '/' . $this->getName() . 'Transformer.php';
    }

    /**
     * Get base path of destination file.
     *
     * @return string
     */
    public function getBasePath()
    {
        return config('repository.generator.basePath', app()->path());
    }

    /**
     * Get array replacements.
     *
     * @return array
     */
    public function getReplacements()
    {
        $modelGenerator = new ModelGenerator();
        return array_merge(parent::getReplacements(),[
            'model_namespace' => $modelGenerator->getRootNamespace()
        ]);
    }
}
        ]);
    }
}

<MSG> Fix generator bug on model with namespace

<DFF> @@ -62,9 +62,14 @@ class TransformerGenerator extends Generator
      */
     public function getReplacements()
     {
-        $modelGenerator = new ModelGenerator();
+        $modelGenerator = new ModelGenerator([
+            'name' => $this->name
+        ]);
+        $model = $modelGenerator->getRootNamespace().'\\'.$modelGenerator->getName();
+        $model = str_replace(["\\",'/'],'\\', $model);
+
         return array_merge(parent::getReplacements(),[
-            'model_namespace' => $modelGenerator->getRootNamespace()
+            'model' => $model
         ]);
     }
 }
\ No newline at end of file

Fix generator bug on model with namespace