Nwidart\Modules\Support\Migrations\SchemaParser::createField PHP Méthode

createField() public méthode

Create field.
public createField ( string $column, array $attributes, $type = 'add' ) : string
$column string
$attributes array
Résultat string
    public function createField($column, $attributes, $type = 'add')
    {
        $results = "\t\t\t" . '$table';
        foreach ($attributes as $key => $field) {
            if (in_array($column, $this->relationshipKeys)) {
                $results .= $this->addRelationColumn($key, $field, $column);
            } else {
                $results .= $this->{"{$type}Column"}($key, $field, $column);
            }
        }
        return $results .= ';' . PHP_EOL;
    }