Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Laravel 5 Essentials

You're reading from   Laravel 5 Essentials Explore the fundamentals of Laravel, one of the most expressive and robust PHP frameworks available

Arrow left icon
Product type Paperback
Published in Apr 2015
Publisher Packt
ISBN-13 9781785283017
Length 144 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Martin Bean Martin Bean
Author Profile Icon Martin Bean
Martin Bean
Arrow right icon
View More author details
Toc

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:

databases:
    - homestead
    - furbook

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

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image