About This Book
Build highly efficient applications with the Eloquent ORM using an expressive syntax
Get to grips with the power of relationships and how Eloquent handles them
Go beyond simple theory with various step-by-step code examples
Who This Book Is For
This book is perfect for developers with some basic knowledge of PHP development, but are new to the Eloquent ORM. However, developers with previous Laravel and Eloquent experience will also benefit from the in-depth analysis of specific classes and methodologies in the book.
What You Will Learn
Configure a new Laravel project and set up database connections in minutes
Build and work with models to handle your data with an expressive syntax
Define relations between your models to create complex functionalities
Query your database using relations simply
Use collections to gather results and perform many operations on them with a powerful data structure
Use the Eloquent ORM without Laravel
Control your models during the request lifecycle with event listeners and observers
Learning Laravel's Eloquent starts off by taking you through setting up your first project and guiding you in creating a perfect Laravel environment. You will learn how to build the right database structure with the Migrations system and the Schema Builder class. Next, you will be introduced to the main element of Eloquent: the model. After treating the model as a single, isolated entity, you will learn how to create relations between them. You will be taken through organizing, filtering, and sorting your data with collections. You will then learn to enhance an application with new features using events and by creating new observers. Towards the end of the book, you will discover how to install, configure, and use the Eloquent ORM without Laravel. The book concludes by walking you through how to deal with complex problems and build advanced and flexible systems.