Laravel Rust Drops Lazy Loading, Requires Explicit Typed Relationship Loading
Laravel Rust, a Rust port of Laravel that entered beta on 1 December 2026, never loads a relationship unless it is explicitly requested. Relationships are declared as typed struct fields with attributes rather than as methods, as Eloquent does. Eager loading uses a typed with() call, so mistakes become compile errors, and reading an unloaded relationship panics in development with a message naming the fix. Constrained relationship queries, typed aggregate counts, and pivot-table data in join_row structs are also supported. The approach trades extra upfront typing for catching N+1 queries and similar errors before runtime.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in