Laravel Eloquent Introduction

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

Eloquent is the ORM built into the Laravel framework. It allows you to interact with your database tables in an object-oriented manner, by use of the ActiveRecord pattern.

A single model class usually maps to a single database table, and also relationships of different types (one-to-one, one-to-many, many-to-many, polymorphic) can be defined between different model classes.

Section Making a Model describes the creation and definition of model classes.

Before you can start using Eloquent models, make sure at least one database connection has been configured in your config/database.php configuration file.

To understand usage of eloquent query builder during development you may use php artisan ide-helper:generate command. Here is the link.


Sub-topic Navigation

Eloquent Relationship



Got any Laravel Question?