src/Database/Schemas/MysqlSchema.php
public function foreignkey($table, $colmun = null)
    {
        $i = Collection::count(self::$colmuns) - 1;
        //
        self::$colmuns[$i] .= ' references '.$table;
        if (!empty($colmun)) {
            self::$colmuns[$i] .= '('.$colmun.')';
        }
        //
        return $this;
    }
public function foreignkey($table, $colmun = null)
    {
        $i = Collection::count(self::$colmuns) - 1;
        //
        self::$colmuns[$i] .= ' references '.$table;
        if (!empty($colmun)) {
            self::$colmuns[$i] .= '('.$colmun.')';
        }
        //
        return $this;
    }
public function foreignkey ( $ table , $ colmun = null ) { $ i = Collection :: count ( self :: $ colmuns ) - 1 ; // self :: $ colmuns [ $ i ] .= ' references ' . $ table ; if ( ! empty ( $ colmun ) ) { self :: $ colmuns [ $ i ] .= '(' . $ colmun . ')' ; } // return $ this ; }
function to add foreign key constraint.

@param string $table
@param string $colmun

@return schema
function to add foreign key constraint .