O'Reilly logo

Learning Laravel's Eloquent by Francesco Malatesta

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

Descending in the code

In the previous text, we analyzed many aspects of the Eloquent model. If you think about your path, in a few pages you learned everything you needed to do many operations with your data. Also, you saw many interesting ways to add behaviors (from accessors and mutators to model observers) in order to improve your code usability, readability, and maintainability.

In this section you are going to read, I will go through the Model class and analyze it a little deeper than the usual. Nothing so advanced, so don't worry: I will just use the class code to show you what you can do with your models.

Take it as a list of useful tips and tricks.

A big file

At the moment I am writing this chapter, the Model class under Illuminate\Database\Eloquent ...

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