From the course: Building RESTful APIs in Laravel

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Creating the database structure

Creating the database structure

From the course: Building RESTful APIs in Laravel

Start my 1-month free trial

Creating the database structure

- [Instructor] Earlier, we created a brand new database and a migration file that will allow us to define how our petitions table will look like. Migrations are not just a convenient way to create a database structure, they also serve as a version control, they are a great way to keep track of any changes to the database structure over time and across a team of developers. Every time we or anyone on our team creates a new table or makes changes to an existing table, the record of this action will be saved in our database migrations directory. Right here. As you can see right now, the table is empty, even if I refresh it, nothing's here. So let's define the actual columns we will need in the table. To do this, we need to check the create petitions table file. The one that we created in the previous video. This class consists of two methods. The up methods and the down method. The up method is where we add what…

Contents