Nwidart\Modules\Support\Migrations\SchemaParser::addRelationColumn PHP Method

addRelationColumn() protected method

Add relation column.
protected addRelationColumn ( integer $key, string $field, string $column ) : string
$key integer
$field string
$column string
return string
    protected function addRelationColumn($key, $field, $column)
    {
        $relatedColumn = snake_case(class_basename($field)) . '_id';
        $method = 'integer';
        return "->{$method}('{$relatedColumn}')";
    }