🔴 Laravel
Beginner
What is Eloquent ORM in Laravel?
Answer
Eloquent is Laravel's built-in ORM (Object-Relational Mapper) that maps database tables to PHP classes. Each Eloquent model represents a database table. By convention, User model maps to the users table. Eloquent provides a beautiful ActiveRecord implementation — CRUD operations: User::find(1), User::create(["name" => "Alice"]), $user->update(["name" => "Bob"]), $user->delete(). It has a fluent query builder: User::where("active", true)->orderBy("name")->paginate(15). Eloquent handles relationships (hasOne, hasMany, belongsTo, belongsToMany, morphTo), casting, scopes, observers, events, and more. It dramatically reduces database boilerplate.