Under Laravel Eloquent’s Hood: The Artisan of the Day Is Chris Morrell.

Under Laravel Eloquent’s Hood: The Artisan of the Day Is Chris Morrell.

Under Laravel Eloquent’s Hood: The Artisan of the Day Is Chris Morrell

"Eloquent relations are just PHP code, like everything else in the framework. Under the hood is just code. We know how to do all sorts of interesting things with code."

Meet Chris Morrell, CEO and CTO of InterNACHI, the largest trade organization for residential and commercial property inspectors globally. With a team of about 35 employees serving over 30,000 members, Chris proves that being a "boss man" doesn't mean stepping away from the technical side.

Chris describes himself as "the type of person who really hates not to understand how things work." This curiosity has led him to spend hours diving into Laravel's source code, contributing with numerous packages, and examining every line of Eloquent he's ever called in his projects. His methodical approach to understanding the framework from the inside out has made him a go-to expert on one of Laravel's most beloved features: Eloquent relationships.

He has his own podcast and is also part of the Laravel community that believes you can just do things.

Advanced Eloquent Relations: Redefining What's Possible

At Laracon US 2025, Chris delivered a talk that challenged developers to think beyond the standard hasMany, belongsTo, and belongsToMany relationships. His presentation, "Advanced Eloquent Relations," demonstrated that relationships are fundamentally just query builders and PHP code, which means the possibilities are nearly limitless.

Real-World Examples (That Aren't So Real-World)

Chris walked attendees through several unconventional relationship examples that, while not recommended for everyday use, illustrate the flexibility of Eloquent:

Comma-Separated Relations Ever inherited a legacy database with comma-separated IDs instead of proper foreign keys? Chris showed how to create a custom HasSpeakers relation that splits those comma-separated values and treats them like a proper hasMany relationship.

Geographic Relations Want to find all ice cream shops within 500 meters of Laracon venues? His HasNear relation uses MySQL's spherical distance calculations to create location-based relationships without traditional foreign keys.

Generated Relations His HasFaker relation uses Laravel's Faker library to generate test data on the fly, perfect for prototyping without hitting the database.

AI-Powered Relations Perhaps most impressively, his HasPredictedEvents relation extends HasMany but passes existing data to Claude (via Prism) to predict future Laravel events, seamlessly blending real database results with AI-generated content.

Chris broke down eager loading into three conceptual phases that every Laravel developer should understand: adding constraints, getting results, and matching. This mental model opens up possibilities most developers never consider.

His examples pushed boundaries while respecting a key principle: "Ninety, ninety-five, ninety-nine percent of the time, you should just stick to conventions." But when your data is shaped differently or business needs fall outside the norm, you have options.

He also ended with a reminder: when the framework conventions don't fit your unique situation, you have one more tool in your toolbelt.

Your Story Belongs Here

You don't need to have a course, a talk, or a big launch. If Laravel has been part of your journey (a pivot, a side project, a moment of growth), we'd love to hear about it!

Answer Taylor's questions at laravel.com/stories.

We're always looking to feature developers from every corner of the community. Beginners, builders, behind-the-scenes folks. If Laravel helped you do something you're proud of, that's a story worth telling.

Keep reading

Stay connected with the latest Laravel news