Back to Courses
intermediate14 lessons~6h4,150 XP

Laravel & Eloquent

From migrations to production-ready APIs — Eloquent ORM, relationships, and the performance patterns real Laravel apps depend on. Based on the official Laravel documentation.

0%

0/14 done

Lesson Path Complete each lesson to unlock the next

Eloquent Models & Mass Assignment

Model / $fillable / $guarded
Locked

Connect a PHP class to a database table, and control exactly which fields can be set in bulk.

Complete Migrations & Schema to unlock

Querying with Eloquent

where() / find() / first() / get()
Locked

Find, filter, and fetch records using Eloquent's expressive, chainable query methods.

Complete Eloquent Models & Mass Assignment to unlock

Query Builder (DB Facade)

DB::table()
Locked

Drop down to Laravel's fluent query builder for raw queries Eloquent isn't the right tool for.

Complete Querying with Eloquent to unlock

Updating & Deleting Records

update() / delete() / firstOrCreate()
Locked

Modify existing rows, remove them, and understand Eloquent's firstOrCreate / updateOrCreate shortcuts.

Complete Query Builder (DB Facade) to unlock

Relationships I: hasOne, belongsTo & hasMany

hasMany() / belongsTo()
Locked

Define how models relate to each other, and let Eloquent fetch related data through clean method calls.

Complete Updating & Deleting Records to unlock

Relationships II: belongsToMany & Pivot Tables

belongsToMany() / pivot
Locked

Model many-to-many relationships through a pivot table, and attach extra data to the connection itself.

Complete Relationships I: hasOne, belongsTo & hasMany to unlock

Eager Loading & the N+1 Problem

with() / load() / preventLazyLoading
Locked

The single most important Laravel performance lesson — load related data in one query, not one-per-row.

Complete Relationships II: belongsToMany & Pivot Tables to unlock

Accessors, Mutators & Casts

Attribute::get/set / $casts
Locked

Transform attribute values automatically every time they're read or written.

Complete Eager Loading & the N+1 Problem to unlock

Query Scopes

Local scope / scope prefix
Locked

Package a reusable WHERE condition as a clean, chainable method name.

Complete Accessors, Mutators & Casts to unlock

Validation & Form Requests

$request->validate() / FormRequest
Locked

Reject bad input before it ever reaches your database, with rules that read like documentation.

Complete Query Scopes to unlock

API Resources & Pagination

JsonResource / paginate()
Locked

Control exactly what shape your JSON API returns, and paginate large result sets correctly.

Complete Validation & Form Requests to unlock

Caching & Query Optimization

Cache::remember() / chunk() / cursor()
Locked

Cache expensive results, and process huge tables without exhausting memory.

Complete API Resources & Pagination to unlock

Queues, Jobs & Database Transactions

ShouldQueue / DB::transaction()
Locked

Move slow work off the request cycle, and guarantee multi-step writes succeed or fail together.

Complete Caching & Query Optimization to unlock