public function foreign(
        $table,
        $localColumnNames,
        $foreignColumnNames = 'id',
        $options = [],
        $constraintName = null
    ) {
        $localColumnNames   = is_array($localColumnNames) ? $localColumnNames : [$localColumnNames];
        $foreignColumnNames = is_array($foreignColumnNames) ? $foreignColumnNames : [$foreignColumnNames];

        return $this->table->addForeignKeyConstraint($table, $localColumnNames, $foreignColumnNames, $options,
            $constraintName);
    }
public function foreign(
        $table,
        $localColumnNames,
        $foreignColumnNames = 'id',
        $options = [],
        $constraintName = null
    ) {
        $localColumnNames   = is_array($localColumnNames) ? $localColumnNames : [$localColumnNames];
        $foreignColumnNames = is_array($foreignColumnNames) ? $foreignColumnNames : [$foreignColumnNames];

        return $this->table->addForeignKeyConstraint($table, $localColumnNames, $foreignColumnNames, $options,
            $constraintName);
    }
public function foreign ( $ table , $ localColumnNames , $ foreignColumnNames = 'id' , $ options = [ ] , $ constraintName = null ) { $ localColumnNames = is_array ( $ localColumnNames ) ? $ localColumnNames : [ $ localColumnNames ] ; $ foreignColumnNames = is_array ( $ foreignColumnNames ) ? $ foreignColumnNames : [ $ foreignColumnNames ] ; return $ this -> table -> addForeignKeyConstraint ( $ table , $ localColumnNames , $ foreignColumnNames , $ options , $ constraintName ) ; }
Specify a foreign key for the table.

@param string       $table
@param array|string $localColumnNames
@param array|string $foreignColumnNames
@param array        $options
@param null         $constraintName

@return Blueprint
Specify a foreign key for the table .