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

Supercharging your models

In Chapter 3, Your First Application, we learned how to use Eloquent to create models that represent the entities of our applications. We defined simple foreign key relationships and we used basic methods such as all(), whereField($value), and find($id). While these are the methods you will use frequently, Eloquent has a ton of other useful features and we will now look at some of the most useful ones.

Simple performance tricks

Just like with any ORM that issues SQL queries for you, with Eloquent you can sometimes shoot yourself in the foot if you do not understand what it does behind the scene. For this reason, we will start by looking at a couple of things to consider improving the overall performance of your application. ...

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