Tutorial by Topics: eloquent



The Eloquent is an ORM (Object Relational Model) included with the Laravel. It implements the active record pattern and is used to interact with relational databases.

Accessors and mutators allow you to format Eloquent attribute values when you retrieve or set them on model instances. For example, you may want to use the Laravel encrypter to encrypt a value while it is stored in the database, and then automatically decrypt the attribute when you access it on an Eloquent model. In addition to custom accessors and mutators, Eloquent can also automatically cast date fields to Carbon instances or even cast text fields to JSON.

We have new features for Eloquent Relationship in Laravel version 5.4.8. We can fetch a single instance of a hasMany (it is just one example) relationship by define it at on place and it will works for all relationship


Page 1 of 1