Book Image

Laravel 5 Essentials

By : Martin Bean
Book Image

Laravel 5 Essentials

By: Martin Bean

Overview of this book

Table of Contents (15 chapters)
Laravel 5 Essentials
About the Author
About the Reviewers

Preparing the database

Before we can expand the functionality of our routes, we need to define the models of our application, prepare the necessary database schema, and populate the database with some initial data.

Homestead ships with a MySQL server built in, so we can use MySQL for our database; however, it does require a little bit of configuration first, before we can use a MySQL database in our application.

The first step is to open our application's configuration file, which should have been created at .env when we created the application with Composer. Find the line that says DB_DATABASE=homestead and change it to DB_DATABASE=furbook.

We can also add the database name to our Homestead configuration file, so that the database is created automatically for us. Open the file from the command line, using the following command:

$ homestead edit

Under the databases section, add a new line:

    - homestead
    - furbook

Save the file, then run the homestead provision command to create...