Eloquent model


Introduction: database operation using Eloquent model

brief introduction Laravel's built-in Eloquent ORM provides a beautiful and simple ActiveRecord implementation for dealing with databases

Published by Xueyuan Jun 6 years ago    Views: 126545    Like: 21

Advanced Chapter: Managing Association Relationship Using Eloquent Model

brief introduction Data tables often need to be associated with other tables. For example, a blog post may have many comments, or an order will be associated with the ordering user. Eloquent lets you organize and process this

Published by Xueyuan Jun 6 years ago    Number of views: 94350    Like: 7

Data format returned by Eloquent query: collection

brief introduction The result set returned by Eloquent containing multiple records is Illuminate Database Eloquent Collecti

Published by Xueyuan Jun 6 years ago    Views: 31796    Number of likes: 5

Formatting model data with accessors and modifiers

brief introduction Accessors and modifiers allow you to format Eloquent properties when you get model properties or set their values. For example, you may want to use the Larravel encryptor to

Published by Xueyuan Jun 6 years ago    Views: 29019    Like: 9

API resource class: bridge between the model and JSON API

brief introduction When building the API, a conversion layer may be required between the Eloquent model and the JSON response finally returned to the application user. Larave's

Published by Xueyuan Jun 6 years ago    Views: 25232    Number of likes: 5

Serialize model data into arrays or JSON

brief introduction When building JSON APIs, you often need to convert models and associations into arrays or JSON. Eloquent provides a convenient way to implement these transformations

Published by Xueyuan Jun 6 years ago    Views: 25777    Number of likes: 4

search result