Creating a Single Migration File with Multiple Steps

We combine all of the steps in previous videos into one self-contained migration file.

In a com­bined migra­tion file, the safeUp method would look like this:

    public function safeUp()
    {
        return($this->_addFormSection() &&
            $this->_addFormGroup() &&
            $this->_addFormFields() &&
            $this->_addFieldLayout()
        );
    }

The return state­ment would call the dif­fer­ent pri­vate meth­ods and run the code to do a part of the over­all migration. 

Instructor
Ryan Irelan
Level
Intermediate
Date Published
November 23, 2021
Ryan Irelan

I am the creator of CraftQuest, a web developer, and former software team manager. I spend most of my time improving CraftQuest with code and courses. When I'm not in front of the computer, I spend my time with my family, and running on the roads and trails of Austin, TX.