Tony Messias

February 14, 2026

On Delegated Types and Laravel

Delegated Types is one of my favorite patterns when it comes to Active Record ORMs. It's a twist to the regular polymorphic relationships you might be used to, but kinda flipped on its head. Alan Kay has a quote that I think fits here well:

Simple things should be simple, complex things should be possible.

I think Delegated Types embodies this idea. It allows us to build shared behavior only once, represent hierarchy structures richer than the traditional "post has many comments", easily track historical changes on our data model by using the delegated type as a cursor/pointer by turning edits into first-class citizens, and much more.

It's a pattern that was documented in Rails, but we can use it in Laravel and Eloquent too! I wrote about it in "Introduction to Delegated Types" on Tighten's blog; check it out if you're curious. And if you do, let me know what you think!

About Tony Messias