In the latest post to the SitePoint PHP blog Aleksander Koko continues with his series about creating an application with PHP and EmberJS with a look at building databases. In the first part of the series he introduced the main toolset and set up a simple Laravel application inside of a Homestead instance. This latest post builds on that platform.
In this part, we will create the structure of the database. We will create the tables using migrations and seed the database using seeders. Also, you will learn how to grab some random images from LoremPixel and put them on the filesystem using Flysystem. You’ll also be adding some randomly generated data using the Faker library. Much like with part 1, you can download this part’s code from github.
He shows you how to get all the needed libraries installed and run the migrate command to create the needed tables. He also helps you set up a Dropbox application so you can use their API and configure the application with your API settings. Next he modifies the migrations and seeds the sample data. Next up he makes the models for each of the tables and integrates Faker to populate them with better seed data, making seeder classes to handle some of the more custom logic.