protected function getUpStub()
    {
        switch($this->action) {
            case 'add':
            case 'insert':
                $upMethod = $this->file->get(__DIR__ . '/templates/migration/migration-up.txt');
                $fields = $this->fields ? $this->setFields('addColumn') : '';
                break;

            case 'remove':
            case 'drop':
            case 'delete':
                $upMethod = $this->file->get(__DIR__ . '/templates/migration/migration-up.txt');
                $fields = $this->fields ? $this->setFields('dropColumn') : '';
                break;

            case 'pivot':
                $upMethod = $this->file->get(__DIR__ .'/templates/migration/migration-up-pivot.txt');
                $fields = $this->fields ? $this->setFields('addColumn') : '';
                break;

            case 'destroy':
                $upMethod = $this->file->get(__DIR__ . '/templates/migration/migration-up-drop.txt');
                $fields = $this->fields ? $this->setFields('dropColumn') : '';
                break;

            case 'create':
            case 'make':
            default:
                $upMethod = $this->file->get(__DIR__ . '/templates/migration/migration-up-create.txt');
                $fields = $this->fields ? $this->setFields('addColumn') : '';
                break;
        }

        // Replace the tableName in the template
        $upMethod = str_replace('{{tableName}}', $this->tableName, $upMethod);

        // Insert the schema into the up method
        return str_replace('{{methods}}', $fields, $upMethod);
    }
protected function getUpStub()
    {
        switch($this->action) {
            case 'add':
            case 'insert':
                $upMethod = $this->file->get(__DIR__ . '/templates/migration/migration-up.txt');
                $fields = $this->fields ? $this->setFields('addColumn') : '';
                break;

            case 'remove':
            case 'drop':
            case 'delete':
                $upMethod = $this->file->get(__DIR__ . '/templates/migration/migration-up.txt');
                $fields = $this->fields ? $this->setFields('dropColumn') : '';
                break;

            case 'pivot':
                $upMethod = $this->file->get(__DIR__ .'/templates/migration/migration-up-pivot.txt');
                $fields = $this->fields ? $this->setFields('addColumn') : '';
                break;

            case 'destroy':
                $upMethod = $this->file->get(__DIR__ . '/templates/migration/migration-up-drop.txt');
                $fields = $this->fields ? $this->setFields('dropColumn') : '';
                break;

            case 'create':
            case 'make':
            default:
                $upMethod = $this->file->get(__DIR__ . '/templates/migration/migration-up-create.txt');
                $fields = $this->fields ? $this->setFields('addColumn') : '';
                break;
        }

        // Replace the tableName in the template
        $upMethod = str_replace('{{tableName}}', $this->tableName, $upMethod);

        // Insert the schema into the up method
        return str_replace('{{methods}}', $fields, $upMethod);
    }
protected function getUpStub ( ) { switch ( $ this -> action ) { case 'add' : case 'insert' : $ upMethod = $ this -> file -> get ( __DIR__ . '/templates/migration/migration-up.txt' ) ; $ fields = $ this -> fields ? $ this -> setFields ( 'addColumn' ) : '' ; break ; case 'remove' : case 'drop' : case 'delete' : $ upMethod = $ this -> file -> get ( __DIR__ . '/templates/migration/migration-up.txt' ) ; $ fields = $ this -> fields ? $ this -> setFields ( 'dropColumn' ) : '' ; break ; case 'pivot' : $ upMethod = $ this -> file -> get ( __DIR__ . '/templates/migration/migration-up-pivot.txt' ) ; $ fields = $ this -> fields ? $ this -> setFields ( 'addColumn' ) : '' ; break ; case 'destroy' : $ upMethod = $ this -> file -> get ( __DIR__ . '/templates/migration/migration-up-drop.txt' ) ; $ fields = $ this -> fields ? $ this -> setFields ( 'dropColumn' ) : '' ; break ; case 'create' : case 'make' : default : $ upMethod = $ this -> file -> get ( __DIR__ . '/templates/migration/migration-up-create.txt' ) ; $ fields = $ this -> fields ? $ this -> setFields ( 'addColumn' ) : '' ; break ; } // Replace the tableName in the template $ upMethod = str_replace ( '{{tableName}}' , $ this -> tableName , $ upMethod ) ; // Insert the schema into the up method return str_replace ( '{{methods}}' , $ fields , $ upMethod ) ; }
Grab up method stub and replace template vars

@return string
Grab up method stub and replace template vars