O'Reilly logo

Mastering Laravel by Christopher John Pecoraro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 2. Automating Tests – Migrating and Seeding Your Database

So far, we have created some base models and the general outline of the database. Now, we need to create database migrations and seeding. Traditionally, database "dump" files have been used as a way to pass around both the schema, which is the structure of the tables, and the data, which would be the initial or predefined records, such as default values; unchanging lists, such as cities or countries; and users such as "admin". These dump files that contain SQL can be committed to source code control. This is not always the best way to maintain the integrity of the database; since every time a developer adds records or modifies the database, all of the developers in the team would ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required