Eloquent is the ORM that is behind Laravel's database queries. It's an abstraction of active record implementation.
As we saw previously, each application model has a respective table in our database. With this, we can query, insert, delete, and update records.
The Eloquent ORM uses the snake case plural name of the class, which will be used as the table name, unless another name is explicitly specified. For example, our Bike model class has its own table bikes.
The application models have the following tables:
Application Model | Database Table |
---|---|
Bike.php | bikes |
Builder.php | builders |
Garage.php | garages |
Item.php | items |
Rating.php | ratings |
Builder.php | builders |
User.php | users |
Note that we keep the table convention name, but it is possible to use a custom table name. For the scope of this book, we will keep the table names generated...