How to use Eloquent object-relational mapping in PHP's Laravel framework
This article is about how Eloquent object-relational mapping is used in PHP's Laravel framework. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Zero, what is Eloquent
Eloquent is the 'ORM', is' Object Relational Mapping', object-relational mapping of Laravel. The emergence of ORM is to help us to make the operation of the database more convenient.
Eloquent makes a 'Model class' correspond to a database table, and encapsulates a lot of 'function',' at the bottom to make it very easy for the Model class to call.
Let's take a look at the following code: