Eloquent is Laravel 2,157 's ActiveRecord ORM: one class per table, one object per row, and the query builder of The Query Builder behind every static call. Here it meets the MySQL bookshop, a schema Laravel did not create, so you see the conventions and their overrides. Relationships follow in Eloquent Relationships, eager loading in Eager Loading.
The examples ran on Laravel 13.33.0, PHP 8.5 and MySQL 9.7 524 (database shop), plus two migrations adding a coupons table and a deleted_at column. Each snippet ran in php artisan tinker --execute behind DB::listen(fn ($q) => print('-- '.$q->toRawSql().PHP_EOL)), which prints every statement with a -- prefix; long lines are wrapped.
