Populate the place-holders in the migration stub.

@param  string  $name
@param  string  $stub
@param  string  $table
@return string
339241
protected function populateStub($name, $stub, $table)
    {
        $stub = str_replace('{{class}}', $this->getClassName($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;
    }
708385
protected function resolveTableNames($table,$name)
	{
		$parts=explode('.',str_replace('"','',$name));
		if(isset($parts[1]))
		{
			$schemaName=$parts[0];
			$tableName=$parts[1];
		}
		else
		{
			$schemaName=self::DEFAULT_SCHEMA;
			$tableName=$parts[0];
		}

		$table->name=$tableName;
		$table->schemaName=$schemaName;
		if($schemaName===self::DEFAULT_SCHEMA)
			$table->rawName=$this->quoteTableName($tableName);
		else
			$table->rawName=$this->quoteTableName($schemaName).'.'.$this->quoteTableName($tableName);
	}
1199539
protected function getStub($table, $create)
    {
        if (is_null($table)) {
            return file_get_contents($this->stubPath() . '/blank.stub');
        }

        // We also have stubs for creating new tables and modifying existing tables
        // to save the developer some typing when they are creating a new tables
        // or modifying existing tables. We'll grab the appropriate stub here.

        $stub = $create ? 'create.stub' : 'update.stub';

        return file_get_contents($this->stubPath() . "/{$stub}");
    }
71458
protected function replaceTableName(&$stub)
    {
        $table = $this->meta['table'];

        $stub = str_replace('{{table}}', $table, $stub);

        return $this;
    }
592619
protected function replaceName(&$stub, $name)
    {
        $stub = str_replace('DummyTitle', $name, $stub);
        $stub = str_replace('DummyUCtitle', ucfirst(studly_case($name)), $stub);
        return $this;
    }
1025983
protected function getTemplate($template, $name)
    {
        // We begin by fetching the master migration stub.
        $stub = $this->file->get(__DIR__.'/templates/migration/migration.txt');

        // Next, set the migration class name
        $stub = str_replace('{{name}}', \Str::studly($name), $stub);

        // Now, we're going to handle the tricky
        // work of creating the Schema
        $upMethod = $this->getUpStub();
        $downMethod = $this->getDownStub();

        // Finally, replace the migration stub with the dynamic up and down methods
        $stub = str_replace('{{up}}', $upMethod, $stub);
        $stub = str_replace('{{down}}', $downMethod, $stub);

        return $stub;
    }
654798
protected function replaceNamespace(&$stub, $name)
    {
        $stub = str_replace(
            ['DummyNamespace', 'DummyRootNamespace', 'NamespacedDummyUserModel'],
            [$this->getNamespace($name), $this->rootNamespace(), $this->userProviderModel()],
            $stub
        );

        return $this;
    }
1073011
protected function replaceNamespace(&$stub, $name)
    {
        $path = $this->option('path');
        $namespace = $this->option('namespace');

        if (!$namespace) {
            $namespace = $this->formGenerator->getClassInfo($name)->namespace;

            if ($path) {
                $namespace = str_replace('/', '\\', trim($path, '/'));
                foreach ($this->getAutoload() as $autoloadNamespace => $autoloadPath) {
                    if (preg_match('|'.$autoloadPath.'|', $path)) {
                        $namespace = str_replace([$autoloadPath, '/'], [$autoloadNamespace, '\\'], trim($path, '/'));
                    }
                }
            }
        }

        $stub = str_replace('{{namespace}}', $namespace, $stub);

        return $this;
    }
549892
protected function makeTransformer(string $name, string $stub):string
    {
        $stub = $this->replaceNamespace($stub);
        $stub = $this->replaceClass($stub, $name);
        $stub = $this->replaceModel($stub, $name);

        return $stub;
    }
1186781
public function stub(string $name, bool $isNewRule = true): StubVerifier
    {
        $key = strtolower($name);

        if (isset($this->state->stubs->$key)) {
            $stub = $this->state->stubs->$key;
        } else {
            $stub = $this->state->stubs->$key = $this->createStub($name);
        }

        if ($isNewRule) {
            $stub->closeRule();
        }

        return $stub;
    }
1006506
protected function replaceClassNameLowerCase(&$stub, $name)
    {
        $stub = str_replace(
            '[[DummyClassNameLowerCase]]', Str::plural(Str::lower($this->getNameInput())), $stub
        );

        return $this;
    }
539340
public function replaceClassName($stub, $tableName)
    {
        return str_replace('{{class}}', $this->options['singular'] ? str_singular(studly_case($tableName)): studly_case($tableName), $stub);
    }
871203
protected function replaceNamespace(&$stub, $name)
	{
		$stub = str_replace(
			'{{namespace}}', $this->getNamespace($name), $stub
		);

		$stub = str_replace(
			'{{rootNamespace}}', $this->getAppNamespace(), $stub
		);

		return $this;
	}
310592
protected function replaceClass(&$stub, $name)
    {
        $class = str_replace($this->getNamespace($name).'\\', '', $name);

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

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

        $modelName = $this->getModelClass($name);

        $this->replaceModelNamespace($stub, $modelName)
             ->replaceModelClass($stub, $modelName)
             ->replaceBaseRepositoryNamespace($stub, $this->base)
             ->replaceBaseRepositoryClass($stub, $this->base);

        return $stub;
    }
1121674
protected function populateStub($name, $stub, $table,$content)
    {
        $stub = str_replace(
             ['DummyClass','DummyName','DummyTables'],
             [$this->getClassName($name),strtolower($table),$content],
             $stub
        );
        // $stub = str_replace('DummyClass', $this->getClassName($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('DummyTable', $table, $stub);
        // }

        return $stub;
    }
782705
protected function buildClass($name)
    {
        $stub = $this->files->get($this->getStub());

        $this->replaceNamespace($stub, $name);
        $this->replaceClassName($stub);
        $this->replaceSchema($stub);
        $this->replaceTableName($stub);

        return $stub;
    }