source/Spiral/ORM/Helpers/ColumnRenderer.php
public function renderColumns(
        array $fields,
        array $defaults,
        AbstractTable $table
    ): AbstractTable {
        foreach ($fields as $name => $definition) {
            $column = $table->column($name);

            //Declaring our column
            $this->declareColumn(
                $column,
                $definition,
                array_key_exists($name, $defaults),
                $defaults[$name] ?? null
            );
        }

        return clone $table;
    }
public function renderColumns(
        array $fields,
        array $defaults,
        AbstractTable $table
    ): AbstractTable {
        foreach ($fields as $name => $definition) {
            $column = $table->column($name);

            //Declaring our column
            $this->declareColumn(
                $column,
                $definition,
                array_key_exists($name, $defaults),
                $defaults[$name] ?? null
            );
        }

        return clone $table;
    }
public function renderColumns ( array $ fields , array $ defaults , AbstractTable $ table ) : AbstractTable { foreach ( $ fields as $ name => $ definition ) { $ column = $ table -> column ( $ name ) ; //Declaring our column $ this -> declareColumn ( $ column , $ definition , array_key_exists ( $ name , $ defaults ) , $ defaults [ $ name ] ?? null ) ; } return clone $ table ; }
Render columns in table based on string definition.

Example:
renderColumns([
'id'     => 'primary',
'time'   => 'datetime, nullable',
'status' => 'enum(active, disabled)'
], [
'status' => 'active',
'time'   => null, //idential as if define column as null
], $table);

Attention, new table instance will be returned!

@param array         $fields
@param array         $defaults
@param AbstractTable $table

@return AbstractTable

@throws ColumnRenderException
Render columns in table based on string definition .