protected function generatableColumn($type, Fluent $column)
    {
        if (! $column->autoIncrement && is_null($column->generatedAs)) {
            return $type;
        }

        if ($column->autoIncrement && is_null($column->generatedAs)) {
            return with([
                'integer' => 'serial',
                'bigint' => 'bigserial',
                'smallint' => 'smallserial',
            ])[$type];
        }

        $options = '';

        if (! is_bool($column->generatedAs) && ! empty($column->generatedAs)) {
            $options = sprintf(' (%s)', $column->generatedAs);
        }

        return sprintf(
            '%s generated %s as identity%s',
            $type,
            $column->always ? 'always' : 'by default',
            $options
        );
    }
protected function generatableColumn($type, Fluent $column)
    {
        if (! $column->autoIncrement && is_null($column->generatedAs)) {
            return $type;
        }

        if ($column->autoIncrement && is_null($column->generatedAs)) {
            return with([
                'integer' => 'serial',
                'bigint' => 'bigserial',
                'smallint' => 'smallserial',
            ])[$type];
        }

        $options = '';

        if (! is_bool($column->generatedAs) && ! empty($column->generatedAs)) {
            $options = sprintf(' (%s)', $column->generatedAs);
        }

        return sprintf(
            '%s generated %s as identity%s',
            $type,
            $column->always ? 'always' : 'by default',
            $options
        );
    }
protected function generatableColumn ( $ type , Fluent $ column ) { if ( ! $ column -> autoIncrement && is_null ( $ column -> generatedAs ) ) { return $ type ; } if ( $ column -> autoIncrement && is_null ( $ column -> generatedAs ) ) { return with ( [ 'integer' => 'serial' , 'bigint' => 'bigserial' , 'smallint' => 'smallserial' , ] ) [ $ type ] ; } $ options = '' ; if ( ! is_bool ( $ column -> generatedAs ) && ! empty ( $ column -> generatedAs ) ) { $ options = sprintf ( ' (%s)' , $ column -> generatedAs ) ; } return sprintf ( '%s generated %s as identity%s' , $ type , $ column -> always ? 'always' : 'by default' , $ options ) ; }
Create the column definition for a generatable column.

@param  string  $type
@param  \Illuminate\Support\Fluent  $column
@return string
Create the column definition for a generatable column .