Replace the default base repository class name for the given stub.

@param  string $stub
@param  string $name
@return $this
198896
protected function replaceBaseRepositoryClass(&$stub, $name)
    {
        $baseClass = str_replace($this->getNamespace($name) . '\\', '', $name);
        $stub      = str_replace('BaseRepositoryClass', $baseClass, $stub);

        return $this;
    }
1336507
protected function replaceUserNamespace($stub)
    {
        $config = $this->container['config'];

        //
        $namespaceModel = $config->get('auth.providers.users.model', 'App\Models\User');

        $model = class_basename(trim($namespaceModel, '\\'));

        //
        $stub = str_replace('{{fullUserModel}}', $namespaceModel, $stub);

        return str_replace('{{userModel}}', $model, $stub);
    }
367102
protected function replaceTimestamp(&$stub, $timestamps)
    {
        $useTimestamps = $timestamps ? '' : "public \$timestamps = false;\n";

        $stub = str_replace('DummyTimestamp', $useTimestamps, $stub);

        return $this;
    }
223385
protected function replaceModelClass(&$stub, $name)
    {
        $names = explode('\\', $name);
        $class = array_pop($names);

        $stub = str_replace('DummyModelClass', $class, $stub);

        return $this;
    }
1353976
protected function replaceUserNamespace($stub)
    {
        $model = $this->userProviderModel();

        if (! $model) {
            return $stub;
        }

        return str_replace(
            $this->rootNamespace().'User',
            $model,
            $stub
        );
    }
1301955
protected function populateStub($name, $stub, $label)
    {
        $stub = str_replace('DummyClass', studly_case($name), $stub);

        // Here we will replace the label place-holders with the label specified by
        // the developer, which is useful for quickly creating a labels creation
        // or update migration from the console instead of typing it manually.
        if ( ! is_null($label))
        {
            $stub = str_replace('DummyLabel', $label, $stub);
        }

        return $stub;
    }
653595
protected function populateStub($stub, $className, $interface)
    {
        $stub = str_replace('ProxyClass', $className, $stub);
        $stub = str_replace('ProxyInterface', '\\'.$interface, $stub);

        $stub = str_replace('// ## Implemented Methods ##', $this->getMethodDefinitions($interface), $stub);

        return $stub;
    }
1310072
protected function replaceModel($stub, $model)
    {
        $model = str_replace('/', '\\', $model);

        $namespaceModel =
            trim($this->laravel->getNamespace(), '\\')
            . $this->getModuleNamespace()
            . config('stubs.namespaces.model') . '\\'
            . $model;

        if (Str::startsWith($model, '\\')) {
            $stub = str_replace('NamespacedDummyModel', trim($model, '\\'), $stub);
        } else {
            $stub = str_replace('NamespacedDummyModel', $namespaceModel, $stub);
        }

        $stub = str_replace(
            "use {$namespaceModel};\nuse {$namespaceModel};", "use {$namespaceModel};", $stub
        );

        $model = class_basename(trim($model, '\\'));
        $stub = str_replace('DocDummyModel', Str::snake($model, ' '), $stub);
        $stub = str_replace('DummyModel', $model, $stub);

        return str_replace('dummyModel', Str::camel($model), $stub);
    }
680487
protected function buildClass($name)
    {
        $subNameArray = explode('.', $name);
        $stub = $this->files->get($this->getStub() . '/' . array_pop($subNameArray) . '.blade.stub');

        return $stub;
    }
313334
protected function replaceNamespace(string $stub):string
    {
        if (method_exists($this->laravel, 'getNameSpace')) {
            $namespace = $this->laravel->getNamespace() . 'Transformers';
        } else {
            $namespace = 'App\Transformers';
        }

        $stub = str_replace('DummyNamespace', $namespace, $stub);

        return $stub;
    }
818768
protected function populateStub($name, $stub, $table)
	{
		$stub = str_replace('{{class}}', studly_case($name), $stub);

		// Here we will replace the table place-holders with the table specified by
		// the developer, which is useful for quickly creating a tables creation
		// or update migration from the console instead of typing it manually.
		if ( ! is_null($table))
		{
			$stub = str_replace('{{table}}', $table, $stub);
		}

		return $stub;
	}
1057684
protected function buildClass($name)
    {
        if ($name == $this->qualifyClass('BaseFilter')) {
            $stub = $this->files->get($this->getStub($name));

            return $this->replaceNamespace($stub, $name)->replaceClass($stub, $name);
        }

        return parent::buildClass($name);
    }
605399
protected function replaceNamespace(&$stub)
    {
        $stub = str_replace(
            ['DummyVendor', 'DummyName', 'DummyLowerVendor', 'DummyLowerName'],
            [$this->getVendorInput(), $this->getNameInput(), strtolower($this->getVendorInput()), strtolower($this->getNameInput())],
            $stub
        );

        return $this;
    }
1022440
protected function buildClass($name)
	{
		$stub = parent::buildClass($name);

		$stub = str_replace(
			'{{command}}', class_basename($this->option('command')), $stub
		);

		$stub = str_replace(
			'{{fullCommand}}', $this->option('command'), $stub
		);

		return $stub;
	}
67627
protected function replaceNamespace(&$stub, $name)
    {
        $stub = str_replace(
            '{{namespace}}',
            $this->formGenerator->getClassInfo($name)->namespace,
            $stub
        );

        return $this;
    }
1332252
protected function replaceStandardLabels(&$stub, array $items)
    {
        foreach ($items as $labels) {
            foreach ($labels as $label) {
                $text = $label->isPlain ? sprintf("'%s'", $label->text) : sprintf("trans('%s')", $label->localeGroup);
                $stub = $this->strReplace($label->template, $text, $stub);
            }
        }

        return $this;
    }
675990
protected function replaceNamespace($stub)
    {
        $stub = str_replace('DummyNamespace', $this->getNamespace(), $stub);
        $stub = str_replace('DummyRootNamespace', trim($this->laravel->getNamespace(), '\\'), $stub);

        return $stub;
    }