O'Reilly logo

Getting Started with Laravel 4 by Raphaël Saunier

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

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. To keep things simple and also show the flexibility of the Eloquent ORM, we are going to use SQLite, a lightweight file-based database.

To configure Laravel to use SQLite, open app/config/database.php and change the default database connection name from mysql to sqlite. Also make sure that the default database file, app/database/production.sqlite, exists.

Creating the Eloquent models

The first and easiest step is to define the models with which our application is going to interact. At the beginning of this chapter, we identified two main ...

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