src/Neutrino/Database/Schema/Blueprint.php
protected function addIndex($type, $columns, $name = null)
    {
        $columns = (array)$columns;

        // If no name was specified for this index, we will create one using a basic
        // convention of the table name, followed by the columns, followed by an
        // index type, such as primary or index, which makes the index unique.
        $name = $name ?: $this->createIndexName($type, $columns);

        return $this->indexes[] = new Definition(['name' => $name, 'columns' => $columns, 'type' => strtoupper($type)]);
    }
protected function addIndex($type, $columns, $name = null)
    {
        $columns = (array)$columns;

        // If no name was specified for this index, we will create one using a basic
        // convention of the table name, followed by the columns, followed by an
        // index type, such as primary or index, which makes the index unique.
        $name = $name ?: $this->createIndexName($type, $columns);

        return $this->indexes[] = new Definition(['name' => $name, 'columns' => $columns, 'type' => strtoupper($type)]);
    }
Add a new command to the blueprint.

@param  string          $type
@param  string|string[] $columns
@param  string|null     $name

@return \Neutrino\Database\Schema\Definition