Laralib\L5scaffold\Makes\MakeModel::buildFillable PHP Method

buildFillable() protected method

Build stub replacing the variable template.
protected buildFillable ( &$stub ) : string
return string
    protected function buildFillable(&$stub)
    {
        $schemaArray = [];
        $schema = $this->scaffoldCommandObj->getMeta()['schema'];
        if ($schema) {
            $items = (new SchemaParser())->parse($schema);
            foreach ($items as $item) {
                $schemaArray[] = "'{$item['name']}'";
            }
            $schemaArray = join(", ", $schemaArray);
        }
        $stub = str_replace('{{fillable}}', $schemaArray, $stub);
        return $this;
    }