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.

Visit Resource →

Filed in: Laravel Tutorials / Eloquent
Laravel News Partners

Laravel Jobs

Senior Full Stack Engineer - Laravel
Remote
Givebutter
Laravel partner seeks Lead Developer
Remote
Kirschbaum Development Group
Senior Programmer **Immediate Opening** (send resume to daniel@sbgcorp.com)
Remote
SBG Corp
Web Developer - Laravel
Grand Forks, North Dakota
Center for Rural Health
Senior Full-Stack Laravel Developer
Berlin, Germany
felmo.de

Newsletter

Join 31,000+ others and never miss out on new tips, tutorials, and more.