Skip to main content

Module model

Module model 

Source
Expand description

The ORM: #[derive(Model)] plus the active-record methods it unlocks.

Laravel’s Eloquent resolves everything at runtime — column names, relations, and attributes all live in arrays. Here the derive reads the struct at compile time, so a renamed column is a compile error rather than a null that shows up in production.

Traits§

Model
Implemented by #[derive(Model)]; not written by hand.
ModelExt
The query and persistence methods every model gets.

Functions§

belongs_to
Load the parent of many children in a single query.
has_many
Load the children of many parents in a single query.