Learning Laravel's Eloquent

Develop amazing data-based applications with Eloquent, the Laravel framework ORM

Learning Laravel's Eloquent

Learning
Francesco Malatesta

1 customer reviews
Develop amazing data-based applications with Eloquent, the Laravel framework ORM
$23.99
$29.99
RRP $23.99
RRP $29.99
eBook
Print + eBook

Instantly access this course right now and get the skills you need in 2017

With unlimited access to a constantly growing library of over 4,000 eBooks and Videos, a subscription to Mapt gives you everything you need to learn new skills. Cancel anytime.

Code Files
Preview in Mapt

Book Details

ISBN 139781784391584
Paperback202 pages

Book Description

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.

Table of Contents

Chapter 1: Setting Up Our First Project
Your Swiss Army Knife – Composer
Your safe place – Homestead
The new hideout: Homestead improved
A bonus tool – Adminer
Your best friend: Laravel
The first project – EloquentJourney
Summary
Chapter 2: Building the Database with the Schema Builder Class
The Schema Builder class
Database versioning with the migrations system
Summary
Chapter 3: The Most Important Element – the Model!
Creating a Model
Create, read, update, and delete operations basics
where, aggregates, and other utilities
Mass assignment... for the masses
Timestamps and soft deletes
Query scopes
Attributes casting, accessors, and mutators
Descending in the code
Summary
Chapter 4: Exploring the World of Relationships
The trinity – one to one, one to many, many to many
Querying-related models
Eager loading (and the N + 1 problem)
Inserting and updating related models
Accessing distant relationships
More power – polymorphic relationships
Summary
Chapter 5: Using Collections to Enhance Results
Basic collection operations
Transforming collections
Iterating and filtering
Sorting
Summary
Chapter 6: Everything under Control with Events and Observers
When should I use events in my models?
Model events
An example of model events
Events observers
An example of model observers
Summary
Chapter 7: Eloquent… without Laravel!
Exploring the directory structure
Installing and configuring the database package
Using the ORM
Using the Query and Schema Builder
Summary
Chapter 8: It's Not Enough! Extending Eloquent, Advanced Concepts
Extending the Model: Aweloquent!
Diving into the repository pattern
Summary

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

Authors

Table of Contents

Chapter 1: Setting Up Our First Project
Your Swiss Army Knife – Composer
Your safe place – Homestead
The new hideout: Homestead improved
A bonus tool – Adminer
Your best friend: Laravel
The first project – EloquentJourney
Summary
Chapter 2: Building the Database with the Schema Builder Class
The Schema Builder class
Database versioning with the migrations system
Summary
Chapter 3: The Most Important Element – the Model!
Creating a Model
Create, read, update, and delete operations basics
where, aggregates, and other utilities
Mass assignment... for the masses
Timestamps and soft deletes
Query scopes
Attributes casting, accessors, and mutators
Descending in the code
Summary
Chapter 4: Exploring the World of Relationships
The trinity – one to one, one to many, many to many
Querying-related models
Eager loading (and the N + 1 problem)
Inserting and updating related models
Accessing distant relationships
More power – polymorphic relationships
Summary
Chapter 5: Using Collections to Enhance Results
Basic collection operations
Transforming collections
Iterating and filtering
Sorting
Summary
Chapter 6: Everything under Control with Events and Observers
When should I use events in my models?
Model events
An example of model events
Events observers
An example of model observers
Summary
Chapter 7: Eloquent… without Laravel!
Exploring the directory structure
Installing and configuring the database package
Using the ORM
Using the Query and Schema Builder
Summary
Chapter 8: It's Not Enough! Extending Eloquent, Advanced Concepts
Extending the Model: Aweloquent!
Diving into the repository pattern
Summary

Book Details

ISBN 139781784391584
Paperback202 pages
Read More
From 1 reviews

Read More Reviews