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
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 4. Eloquent ORM

In the previous chapter, we touched on Eloquent, the object-relational mapper (ORM) that ships with Laravel. Eloquent acts as the model layer (the M in MVC) in our applications. As it is such a big part of most applications built in Laravel, we are going to take a look at Eloquent in more detail.

In this chapter, we will cover the following topics:

  • Reading and writing data to our database

  • Relationships between models

  • Query scopes

  • Model events and observers

  • Collections