Eloquent is Laravel's ActiveRecord ORM, where each model class maps to a database table. Models provide fluent query methods like User::find(1) or User::where('active', true)->get(). Attributes like $fillable, $guarded, and $casts control mass assignment and type casting.
← Laravel theorytheory 0/50 · 0%
Eloquent · easy
10. Eloquent Models
The ORM at Laravel's core.
Check your understanding
1. By convention, what table does a 'Post' model map to?
2. Which property whitelists mass-assignable attributes?