public function getMigrationIndex($name)
    {
        foreach ($this->getMigrations() as $key => $migration) {
            if ($migration->name == $name) {
                return $key;
            }
        }

        return -1;
    }
public function getMigrationIndex($name)
    {
        foreach ($this->getMigrations() as $key => $migration) {
            if ($migration->name == $name) {
                return $key;
            }
        }

        return -1;
    }
public function getMigrationIndex ( $ name ) { foreach ( $ this -> getMigrations ( ) as $ key => $ migration ) { if ( $ migration -> name == $ name ) { return $ key ; } } return - 1 ; }
Get the index of a migration by name. It return -1 if not found.

@param string $name

@return int
Get the index of a migration by name . It return - 1 if not found .