Schema::addIndex

public function Schema::addIndex

public Schema::addIndex($table, $name, $fields, array $spec)

Add an index.

@todo remove the $spec argument whenever schema introspection is added.

Parameters

$table: The table to be altered.

$name: The name of the index.

$fields: An array of field names or field information; if field information is passed, it's an array whose first element is the field name and whose second is the maximum length in the index. For example, the following will use the full length of the `foo` field, but limit the `bar` field to 4 characters:

    $fields = ['foo', ['bar', 4]];
  

array $spec: The table specification for the table to be altered. This