Build the class with the given name.

@param string $name

@return string
509198
protected function buildClass($name): string
    {
        $stub = parent::buildClass($name);

        $model = $this->option('model') ?? $this->modelName = $this->ask('What is your model?');

        $transformer = $this->option('transformer') ?? $this->transformerName = $this->ask('What is your transformer?');

        return $this->replaceClasses($stub, $model, $transformer);
    }
1204454
protected function buildClass($name)
    {
        $stub = parent::buildClass($name);

        $indexConfigurator = $this->getIndexConfigurator();

        $stub = str_replace(
            'DummyIndexConfigurator',
            $indexConfigurator ? "{$indexConfigurator}::class" : 'null', $stub
        );

        $searchRule = $this->getSearchRule();

        $stub = str_replace(
            'DummySearchRule',
            $searchRule ? "{$searchRule}::class" : '//', $stub
        );

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

        $tableName = $this->argument('name');
        $className = 'Create' . ucwords($tableName) . 'Table';

        $schema = $this->option('schema');
        $fields = explode(',', $schema);

        $data = array();

        if ($schema) {
            $x = 0;
            foreach ($fields as $field) {
                $fieldArray = explode(':', $field);
                $data[$x]['name'] = trim($fieldArray[0]);
                $data[$x]['type'] = trim($fieldArray[1]);
                $x++;
            }
        }

        $schemaFields = '';
        foreach ($data as $item) {
            switch ($item['type']) {
                case 'char':
                    $schemaFields .= "\$table->char('" . $item['name'] . "');\n";
                    break;

                case 'date':
                    $schemaFields .= "\$table->date('" . $item['name'] . "');\n";
                    break;

                case 'foreign':
                    $model=explode("_", $item['name']);
                    $schemaFields .= "\$table->foreign('" . $item['name'] . "')->references('id')->on('" . $model[0]. "s')->onDelete('cascade');\n";
                    $schemaFields .= "\$table->integer('" . $item['name'] . "')->unsigned();\n";
                    break;

                case 'file':
                    $schemaFields .= "\$table->dateTime('" . $item['name'] . "', 512);\n";
                    break;

                case 'datetime':
                    $schemaFields .= "\$table->dateTime('" . $item['name'] . "');\n";
                    break;

                case 'time':
                    $schemaFields .= "\$table->time('" . $item['name'] . "');\n";
                    break;

                case 'timestamp':
                    $schemaFields .= "\$table->timestamp('" . $item['name'] . "');\n";
                    break;

                case 'text':
                    $schemaFields .= "\$table->text('" . $item['name'] . "');\n";
                    break;

                case 'mediumtext':
                    $schemaFields .= "\$table->mediumText('" . $item['name'] . "');\n";
                    break;

                case 'longtext':
                    $schemaFields .= "\$table->longText('" . $item['name'] . "');\n";
                    break;

                case 'json':
                    $schemaFields .= "\$table->json('" . $item['name'] . "');\n";
                    break;

                case 'jsonb':
                    $schemaFields .= "\$table->jsonb('" . $item['name'] . "');\n";
                    break;

                case 'binary':
                    $schemaFields .= "\$table->binary('" . $item['name'] . "');\n";
                    break;

                case 'number':
                case 'integer':
                    $schemaFields .= "\$table->integer('" . $item['name'] . "');\n";
                    break;

                case 'bigint':
                    $schemaFields .= "\$table->bigInteger('" . $item['name'] . "');\n";
                    break;

                case 'mediumint':
                    $schemaFields .= "\$table->mediumInteger('" . $item['name'] . "');\n";
                    break;

                case 'tinyint':
                    $schemaFields .= "\$table->tinyInteger('" . $item['name'] . "');\n";
                    break;

                case 'smallint':
                    $schemaFields .= "\$table->smallInteger('" . $item['name'] . "');\n";
                    break;

                case 'boolean':
                    $schemaFields .= "\$table->boolean('" . $item['name'] . "');\n";
                    break;

                case 'decimal':
                    $schemaFields .= "\$table->decimal('" . $item['name'] . "');\n";
                    break;

                case 'double':
                    $schemaFields .= "\$table->double('" . $item['name'] . "');\n";
                    break;

                case 'float':
                    $schemaFields .= "\$table->float('" . $item['name'] . "');\n";
                    break;

                default:
                    $schemaFields .= "\$table->string('" . $item['name'] . "');\n";
                    break;
            }
        }

        $primaryKey = $this->option('pk');

        $schemaUp = "
            Schema::create('" . $tableName . "', function(Blueprint \$table) {
                \$table->increments('" . $primaryKey . "');
                " . $schemaFields . "
                \$table->timestamps();
                \$table->softDeletes();
            });
            ";

        $schemaDown = "Schema::drop('" . $tableName . "');";

        return $this->replaceSchemaUp($stub, $schemaUp)
            ->replaceSchemaDown($stub, $schemaDown)
            ->replaceClass($stub, $className);
    }
211861
public function build($name = null)
    {
        $caching = new Caching();
        $caching->setStack(new DebugStack());

        if ($this->debug && isset($this->debugDriver)) {
            $caching->setDriver($this->resolveDriver($this->debugDriver));

            return $caching;
        }

        if (null === $name) {
            $name = $this->configuration->get('caching.default', 'null');
        }

        $driver = $this->resolveDriver($name);
        $caching->setDriver($driver);

        return $caching;
    }
456042
public static function getAdminClass(string $name): string
    {
        $class = "";
        if (empty($name) === false && empty(self::$admin_classes[$name]) === false) {
            $class = self::$admin_classes[$name];
        }
        return $class;
    }
660627
public function getClassName(string $name) : string
    {
        $name = str_replace("/", "\\", $name);
        $name = explode("\\", $name);
        $name = array_pop($name);
        $name = $this->removeNoneAlpherNumeric($name);
        return $name;
    }
682978
protected function buildClass($name)
    {
        $controllerNamespace = $this->getNamespace($name);

        $replace = [];

        if ($this->option('parent')) {
            $replace['DummyFullParentClass'] = $controllerNamespace.'Controller';
            $replace['DummyParentClass'] = class_basename($controllerNamespace.'Controller');
            $replace['parent_dummy_view'] = $this->getParentViewName($name);
            $replace['parent_dummy_route'] = $this->getParentRouteName($name);
        }
        $replace['dummy_view'] = $this->getViewName($name);
        $replace['dummy_route'] = $this->getRouteName($name);

        return str_replace(array_keys($replace), array_values($replace), parent::buildClass($name));
    }
653993
protected function buildClass($name){
        $controllerNamespace = $this->getNamespace($name);
        $replace = [
            'DummyServiceVar' => $this->replaceServiceVar($name),
            'DummyViewPath' => $this->replaceViewPath($name),
            'DummySingularServiceVar' => $this->replaceSingularServiceVar($name)
        ];
        return str_replace(
            array_keys($replace), array_values($replace), $this->generateClass($name)
        );
    }
278188
public function create(string $name)
    {
        $className = $this->getClassName($name);

        $result = $this->createInstance($className);

        return $result;
    }
60875
protected function buildClass($name)
    {
        $stub = parent::buildClass($name);

        if ($model = $this->argument('model')) {
            if (!starts_with($model, $namespace = $this->laravel->getNamespace())) {
                $model = "{$namespace}\\{$model}";
            }
        }

        return $this->replaceModel($stub, $model);
    }
300654
public function buildPrefix($name = null)
    {
        if (empty($name)) {
            $name = 'default';
        } elseif ($name && preg_match('/[^[:alnum:]]/', $name)) {
            $name = md5($name);
        }
        return $this->queuePrefix . ':' . $name;
    }
240595
protected function buildClass($name) {
        $replace = [
            '$componentName' => $name
        ];

        return str_replace(
            array_keys($replace), array_values($replace), $this->generateClass($name)
        );
    }
950523
protected function buildPossiblePages($name)
	{
		$possible_classes = array();
		$class_name = $this->buildClassNameFromName($name);

		foreach ( $this->namespacePrefixes as $prefix ) {
			$possible_classes[] = $prefix . $class_name;
		}

		return $possible_classes;
	}
1255297
protected function getPropertyClassName($name)
    {
        $name = ucfirst($name);
        if (!$this->php7ClassNames) {
            return $name;
        }

        if (substr($name, -8) == 'Property') {
            return $name;
        }

        return $name.'Property';
    }
1128637
protected function getCacheFilename($name)
    {
        $class = substr($this->generateClassName($name), strlen(static::CLASS_PREFIX));

        return str_replace(
            '/',
            DIRECTORY_SEPARATOR,
            sprintf(
                '%s/%s/%s/%s.php',
                $this->getCacheDir(),
                substr($class, 0, 2),
                substr($class, 2, 2),
                substr($class, 4)
            )
        );
    }
635444
protected function buildClass($name)
    {
        $namespaceModel = $this->option('model')
                        ? $this->qualifyClass($this->option('model'))
                        : trim($this->rootNamespace(), '\\').'\\Model';

        $model = class_basename($namespaceModel);

        return str_replace(
            [
                'NamespacedDummyModel',
                'DummyModel',
            ],
            [
                $namespaceModel,
                $model,
            ],
            parent::buildClass($name)
        );
    }
389672
protected function buildClass($name)
    {
        $stub = parent::buildClass($name);

        return $this->replaceModelImport($stub)
                    ->replaceModel($stub)
                    ->replaceColumns($stub)
                    ->replaceAction($stub)
                    ->replaceFilename($stub);
    }