Laravel Tutorials / September 03, 2015

Pushing Polymorphism to the Database

Adam Wathan has a new video on his blog about Pushing Polymorphism to the Database:

After my presentation at Laracon this year, a lot of people asked me how I’d take that same polymorphic approach when the objects would have to be retrieved from the database.

This screencast covers how I’d approach implementing the same idea in a real Laravel application with Eloquent, by using polymorphic relationships and delegation to accomplish the same thing without having to resort to any nasty conditionals.

The video itself is very well done and it’s a great tutorial.

Laravel News Partners

Newsletter

Join the weekly newsletter and never miss out on new tips, tutorials, and more.