protected function parseMigrationName($name)
    {
        // create_users_table
        // add_user_id_to_posts_table
        // create_post_tag_table
        $pieces = explode('_', $name);

        // This is the action that the user
        // wants to take. Create or Delete or Add.
        $action = array_shift($pieces);

        // Adding _table to the migration name is optional
        if (end($pieces) == 'table') array_pop($pieces);

        // Next, we need to determine what the table name is.
        // This is tough, because it could be something like
        // posts, or posts_tags. Further, the migration name could
        // be 'create_posts_tags_table', or 'add_post_id_to_posts_tags_table'
        // So we'll search for the keywords 'to' or 'from'.
        $divider = array_search('to', $pieces);
        if ($divider === false) $divider = array_search('from', $pieces);

        // If we did find one of those "to" or "from" connecting words,
        // we know that what follows is the table name.
        $tableName = ($divider !== false)
            ? implode('_', array_slice($pieces, $divider + 1))
            : implode('_', $pieces);

        // For example: ['add', 'posts']
        return array($action, $tableName);
    }
protected function parseMigrationName($name)
    {
        // create_users_table
        // add_user_id_to_posts_table
        // create_post_tag_table
        $pieces = explode('_', $name);

        // This is the action that the user
        // wants to take. Create or Delete or Add.
        $action = array_shift($pieces);

        // Adding _table to the migration name is optional
        if (end($pieces) == 'table') array_pop($pieces);

        // Next, we need to determine what the table name is.
        // This is tough, because it could be something like
        // posts, or posts_tags. Further, the migration name could
        // be 'create_posts_tags_table', or 'add_post_id_to_posts_tags_table'
        // So we'll search for the keywords 'to' or 'from'.
        $divider = array_search('to', $pieces);
        if ($divider === false) $divider = array_search('from', $pieces);

        // If we did find one of those "to" or "from" connecting words,
        // we know that what follows is the table name.
        $tableName = ($divider !== false)
            ? implode('_', array_slice($pieces, $divider + 1))
            : implode('_', $pieces);

        // For example: ['add', 'posts']
        return array($action, $tableName);
    }
protected function parseMigrationName ( $ name ) { // create_users_table // add_user_id_to_posts_table // create_post_tag_table $ pieces = explode ( '_' , $ name ) ; // This is the action that the user // wants to take. Create or Delete or Add. $ action = array_shift ( $ pieces ) ; // Adding _table to the migration name is optional if ( end ( $ pieces ) == 'table' ) array_pop ( $ pieces ) ; // Next, we need to determine what the table name is. // This is tough, because it could be something like // posts, or posts_tags. Further, the migration name could // be 'create_posts_tags_table', or 'add_post_id_to_posts_tags_table' // So we'll search for the keywords 'to' or 'from'. $ divider = array_search ( 'to' , $ pieces ) ; if ( $ divider === false ) $ divider = array_search ( 'from' , $ pieces ) ; // If we did find one of those "to" or "from" connecting words, // we know that what follows is the table name. $ tableName = ( $ divider !== false ) ? implode ( '_' , array_slice ( $ pieces , $ divider + 1 ) ) : implode ( '_' , $ pieces ) ; // For example: ['add', 'posts'] return array ( $ action , $ tableName ) ; }
Parse some_migration_name into array

@param string $name
@return array
Parse some_migration_name into array